home *** CD-ROM | disk | FTP | other *** search
/ Supercompiler 1997 / SUPERCOMPILER97.iso / Delphi 3.0 / DATA.Z / bde.int < prev    next >
Encoding:
Text File  |  1997-01-30  |  266.2 KB  |  5,454 lines

  1.  
  2. {*******************************************************}
  3. {                                                       }
  4. {       Delphi Visual Component Library                 }
  5. {       BDE Interface Unit                              }
  6. {                                                       }
  7. {       Copyright (c) 1995,97 Borland International     }
  8. {                                                       }
  9. {*******************************************************}
  10.  
  11. unit Bde;
  12.  
  13. {$Z+}
  14.  
  15. interface
  16.  
  17. uses Windows;
  18.  
  19. { Translated from IDAPI.H,  Revision 4.164 }
  20.  
  21. const
  22.   DBIINTFVER         = 300;             { Version of the interface }
  23.   DBIENGVERSION      = 300;             { Version of the engine (3.00) }
  24.  
  25. {-----------------------------------------------------------------------}
  26. {     DBI types                                                         }
  27. {-----------------------------------------------------------------------}
  28.  
  29.  
  30. { sdk debug layer defines }
  31.  
  32. const
  33.   DEBUGON            = $1;
  34.   OUTPUTTOFILE       = $2;
  35.   FLUSHEVERYOP       = $8;
  36.   APPENDTOLOG        = $10;
  37.  
  38. { Constants }
  39.  
  40.   DBIMAXNAMELEN      = 31;              { Name limit (table, field etc) }
  41.   DBIMAXSPNAMELEN    = 64;              { Max stored procedure name length }
  42.   DBIMAXFUNCNAMELEN  = 255;             { Max function name len }
  43.   DBIMAXFLDSINKEY    = 16;              { Max fields in a key }
  44.   DBIMAXKEYEXPLEN    = 220;             { Max Key expression length }
  45.   DBIMAXEXTLEN       = 3;               { Max file extension len, not incl. dot (excluding zero termination) }
  46.   DBIMAXTBLNAMELEN   = 260;             { Max table name length }
  47.   DBIMAXDRIVELEN     = 127;             { Max drive length }
  48.   DBIMAXPATHLEN      = 260;             { Max path+file name len (excluding zero termination) }
  49.   DBIMAXMSGLEN       = 127;             { Max message len }
  50.   DBIMAXVCHKLEN      = 255;             { Max val check len }
  51.   DBIMAXPICTLEN      = 175;             { Max picture len }
  52.   DBIMAXFLDSINSEC    = 256;             { Max fields in security spec }
  53.  
  54.   DBIMAXSCFIELDS     = 32;              { max nbr of fields in a config section }
  55.   DBIMAXSCFLDLEN     = 128;             { max field length }
  56.   DBIMAXSCRECSIZE    = DBIMAXSCFIELDS*DBIMAXSCFLDLEN; { max rec size }
  57.  
  58.   DBIMAXUSERNAMELEN  = 14;              { Max user name (general) }
  59.   DBIMAXXBUSERNAMELEN = 16;             { Max user name length (xBASE) }
  60.   DBIMAXBOOKMARKLEN  = 4104;            { Max Bookmark length }
  61.  
  62.   DBIMAXTRACELEN     = 8192;            { Max trace msg len }
  63.  
  64.   DBIMAXTYPEDESC     = 127;             { Max Type Description size }
  65.   DBIMAXDRSQLSTR     = 8192;            { Max Size of SQL Constraint }
  66.  
  67.   DBIMAXOLEDBNAMELEN = 64;              { Max OLE DB name length }
  68.  
  69. {============================================================================}
  70. {                             G e n e r a l                                  }
  71. {============================================================================}
  72.  
  73. type
  74.   DBIDATE            = Longint;
  75.   TIME               = Longint;
  76.   TIMESTAMP          = Double;
  77.   DBIResult          = Word;         { Function result }
  78.   TypedEnum          = Integer;
  79.   PLocale            = Pointer;
  80.  
  81. { Handle Types }
  82.  
  83.   _hDBIObj           = record end;      { Dummy structure to create "typed" handles }
  84.   hDBIObj            = ^_hDBIObj;       { Generic object handle }
  85.   hDBIDb             = ^_hDBIObj;       { Database handle }
  86.   hDBIQry            = ^_hDBIObj;       { Query handle }
  87.   hDBIStmt           = ^_hDBIObj;       { Statement handle ("new query") }
  88.   hDBICur            = ^_hDBIObj;       { Cursor handle }
  89.   hDBISes            = ^_hDBIObj;       { Session handle }
  90.   hDBIXlt            = ^_hDBIObj;       { Translation handle }
  91.   hDBICfg            = ^_hDBIObj;       { Configuration handle }
  92.   hDBIXact           = ^_hDBIObj;       { Transaction handle }
  93.   hDBIFilter         = ^_hDBIObj;       { Filter handle }
  94.   hDBIDR             = ^_hDBIObj;       { Handle to a Client Data Repository (CDR) Object }
  95.  
  96.  
  97. { Handle Pointers }
  98.  
  99.   phDBIObj           = ^hDBIObj;        { Pointer to Generic object handle }
  100.   phDBIDb            = ^hDBIDb;         { Pointer to Database handle }
  101.   phDBIQry           = ^hDBIQry;        { Pointer to Query handle }
  102.   phDBIStmt          = ^hDBIStmt;       { Pointer to Statement handle }
  103.   phDBICur           = ^hDBICur;        { Pointer to Cursor handle }
  104.   phDBISes           = ^hDBISes;        { Pointer to Session handle }
  105.   phDBIXlt           = ^hDBIXlt;        { Pointer to Translation handle }
  106.   phDBICfg           = ^hDBICfg;        { Pointer to Configuration handle }
  107.   phDBIXact          = ^hDBIXact;       { Pointer to Transaction handle }
  108.   phDBIFilter        = ^hDBIFilter;     { Pointer to Filter handle }
  109.   phDBIDR            = ^hDBIDR;         { Pointer to CDR Handle }
  110.  
  111. { typedefs for buffers of various common sizes: }
  112.  
  113.   DBIPATH            = packed array [0..DBIMAXPATHLEN] of Char; { holds a DOS path }
  114.   DBINAME            = packed array [0..DBIMAXNAMELEN] of Char; { holds a name }
  115.   DBIEXT             = packed array [0..DBIMAXEXTLEN] of Char; { holds an extension EXT }
  116.   DBIDOTEXT          = packed array [0..DBIMAXEXTLEN+1] of Char; { holds an extension EXT including '.' }
  117.   DBIDRIVE           = packed array [0..DBIMAXDRIVELEN] of Char; { holds a drive name }
  118.   DBITBLNAME         = packed array [0..DBIMAXTBLNAMELEN] of Char; { holds a table name }
  119.   DBISPNAME          = packed array [0..DBIMAXSPNAMELEN] of Char; { holds a stored procedure name }
  120.   DBIUSERNAME        = packed array [0..DBIMAXUSERNAMELEN] of Char; { holds a user name }
  121.   DBIKEY             = packed array [0..DBIMAXFLDSINKEY-1] of Word; { holds list of fields in a key }
  122.   DBIKEYEXP          = packed array [0..DBIMAXKEYEXPLEN] of Char; { holds a key expression }
  123.   DBIVCHK            = packed array [0..DBIMAXVCHKLEN] of Byte; { holds a validity check }
  124.   DBIPICT            = packed array [0..DBIMAXPICTLEN] of Char; { holds a picture (Pdox) }
  125.   DBIMSG             = packed array [0..DBIMAXMSGLEN] of Char; { holds an error message }
  126.   DBIDRTYPEDESC      = packed array [0..DBIMAXTYPEDESC] of Char; { holds a Type Description string }
  127.   DBISQLSTR          = packed array [0..DBIMAXDRSQLSTR] of Char; { a SQL string }
  128.  
  129.  
  130. {============================================================================}
  131. {                             Environmental                                  }
  132. {============================================================================}
  133.  
  134. type
  135.   pDBIEnv = ^DBIEnv;
  136.   DBIEnv = packed record                { Struct for defining the environ. }
  137.     szWorkDir       : DBIPATH;          { Working directory }
  138.     szIniFile       : DBIPATH;          { Configuration file }
  139.     bForceLocalInit : WordBool;         { Force local initialization }
  140.     szLang          : DBINAME;          { System language driver }
  141.     szClientName    : DBINAME;          { Client name (documentary) }
  142.   end;
  143.  
  144. {============================================================================}
  145. {                   System Info                                              }
  146. {============================================================================}
  147.  
  148. type
  149.   pSYSVersion = ^SYSVersion;
  150.   SYSVersion = packed record            { System Version Info }
  151.     iVersion        : Word;             { Engine version }
  152.     iIntfLevel      : Word;             { Client Interface level }
  153.     dateVer         : DBIDATE;          { Version date (Compile/Release) }
  154.     timeVer         : Time;             { Version time (Compile/Release) }
  155.     szVersion       : array [0..19] of Char; { Version name (xxx.xxx.xxx.xxx) }
  156.   end;
  157.  
  158.   pSYSConfig = ^SYSConfig;
  159.   SYSConfig = packed record             { System configuration (basic) }
  160.     bLocalShare     : WordBool;         { If Local files will be shared }
  161.     iNetProtocol    : Word;             { Net Protocol (35, 40 etc.) }
  162.     bNetShare       : WordBool;         { If Net files will be shared }
  163.     szNetType       : DBINAME;          { Network type }
  164.     szUserName      : DBIUSERNAME;      { Network user name }
  165.     szIniFile       : DBIPATH;          { Configuration file }
  166.     szLangDriver    : DBINAME;          { System language driver }
  167.   end;
  168.  
  169.   pSYSInfo = ^SYSInfo;
  170.   SYSInfo = packed record               { System Status/Info }
  171.     iBufferSpace    : Word;             { in K }
  172.     iHeapSpace      : Word;             { in K }
  173.     iDrivers        : Word;             { Active/Loaded drivers }
  174.     iClients        : Word;             { Active clients }
  175.     iSessions       : Word;             { Number of sessions (For all clients) }
  176.     iDatabases      : Word;             { Open databases }
  177.     iCursors        : Word;             { Number of cursors }
  178.   end;
  179.  
  180.   pCLIENTInfo = ^CLIENTInfo;
  181.   CLIENTInfo = packed record
  182.     szName          : DBINAME;          { Documentary name }
  183.     iSessions       : Word;             { Number of sessions }
  184.     szWorkDir       : DBIPATH;          { Working directory }
  185.     szLang          : DBINAME;          { System language driver (Client supplied) }
  186.   end;
  187.  
  188.   pSESInfo = ^SESInfo;
  189.   SESInfo = packed record
  190.     iSession        : Word;             { Session id (1..n) }
  191.     szName          : DBINAME;          { Documentary name }
  192.     iDatabases      : Word;             { Open databases }
  193.     iCursors        : Word;             { Open cursors }
  194.     iLockWait       : SmallInt;         { Lock wait time (in seconds) }
  195.     szNetDir        : DBIPATH;          { Net directory location }
  196.     szPrivDir       : DBIPATH;          { Current Private directory }
  197.   end;
  198.  
  199. {============================================================================}
  200. {                             Table / Field Types                            }
  201. {============================================================================}
  202.  
  203. { Driver Types }
  204.  
  205. const
  206.   szPARADOX          = 'PARADOX';
  207.   szDBASE            = 'DBASE';
  208.   szASCII            = 'ASCIIDRV';
  209.   szOLEDB            = 'OLEDBDRV';
  210.   szMSACCESS         = 'MSACCESS'; 
  211.  
  212.  
  213. { Field Types (Logical) }
  214.  
  215.   fldUNKNOWN         = 0;
  216.   fldZSTRING         = 1;               { Null terminated string }
  217.   fldDATE            = 2;               { Date     (32 bit) }
  218.   fldBLOB            = 3;               { Blob }
  219.   fldBOOL            = 4;               { Boolean  (16 bit) }
  220.   fldINT16           = 5;               { 16 bit signed number }
  221.   fldINT32           = 6;               { 32 bit signed number }
  222.   fldFLOAT           = 7;               { 64 bit floating point }
  223.   fldBCD             = 8;               { BCD }
  224.   fldBYTES           = 9;               { Fixed number of bytes }
  225.   fldTIME            = 10;              { Time        (32 bit) }
  226.   fldTIMESTAMP       = 11;              { Time-stamp  (64 bit) }
  227.   fldUINT16          = 12;              { Unsigned 16 bit integer }
  228.   fldUINT32          = 13;              { Unsigned 32 bit integer }
  229.   fldFLOATIEEE       = 14;              { 80-bit IEEE float }
  230.   fldVARBYTES        = 15;              { Length prefixed var bytes }
  231.   fldLOCKINFO        = 16;              { Look for LOCKINFO typedef }
  232.   fldCURSOR          = 17;              { For Oracle Cursor type }
  233.  
  234.   MAXLOGFLDTYPES     = 18;              { Number of logical fieldtypes }
  235.  
  236. { Sub Types (Logical) }
  237.  
  238. { fldFLOAT subtype }
  239.  
  240.   fldstMONEY         = 21;              { Money }
  241.  
  242. { fldBLOB subtypes }
  243.  
  244.   fldstMEMO          = 22;              { Text Memo }
  245.   fldstBINARY        = 23;              { Binary data }
  246.   fldstFMTMEMO       = 24;              { Formatted Text }
  247.   fldstOLEOBJ        = 25;              { OLE object (Paradox) }
  248.   fldstGRAPHIC       = 26;              { Graphics object }
  249.   fldstDBSOLEOBJ     = 27;              { dBASE OLE object }
  250.   fldstTYPEDBINARY   = 28;              { Typed Binary data }
  251.   fldstACCOLEOBJ     = 29;              { Access OLE object }
  252.  
  253. { fldZSTRING subtype }
  254.  
  255.   fldstPASSWORD      = 1;               { Password }
  256.  
  257. { fldINT32 subtype }
  258.  
  259.   fldstAUTOINC       = 29;
  260.  
  261. { Paradox types (Physical) }
  262.  
  263.   fldPDXCHAR         = $101;            { Alpha    (string) }
  264.   fldPDXNUM          = $102;            { Numeric }
  265.   fldPDXMONEY        = $103;            { Money }
  266.   fldPDXDATE         = $104;            { Date }
  267.   fldPDXSHORT        = $105;            { Short }
  268.   fldPDXMEMO         = $106;            { Text Memo       (blob) }
  269.   fldPDXBINARYBLOB   = $107;            { Binary data     (blob) }
  270.   fldPDXFMTMEMO      = $108;            { Formatted text  (blob) }
  271.   fldPDXOLEBLOB      = $109;            { OLE object      (blob) }
  272.   fldPDXGRAPHIC      = $10A;            { Graphics object (blob) }
  273.   fldPDXBLOB         = fldPDXMEMO;
  274.   fldPDXLONG         = $10B;            { Long }
  275.   fldPDXTIME         = $10C;            { Time }
  276.   fldPDXDATETIME     = $10D;            { Time Stamp }
  277.   fldPDXBOOL         = $10E;            { Logical }
  278.   fldPDXAUTOINC      = $10F;            { Auto increment (long) }
  279.   fldPDXBYTES        = $110;            { Fixed number of bytes }
  280.   fldPDXBCD          = $111;            { BCD (32 digits) }
  281.   fldPDXUNICHAR      = $112;            { not supported yet }
  282.  
  283. { xBASE types (Physical) }
  284.  
  285.   fldDBCHAR          = $201;            { Char string }
  286.   fldDBNUM           = $202;            { Number }
  287.   fldDBMEMO          = $203;            { Memo          (blob) }
  288.   fldDBBOOL          = $204;            { Logical }
  289.   fldDBDATE          = $205;            { Date }
  290.   fldDBFLOAT         = $206;            { Float }
  291.   fldDBLOCK          = $207;            { Logical type is LOCKINFO }
  292.   fldDBOLEBLOB       = $208;            { OLE object    (blob) }
  293.   fldDBBINARY        = $209;            { Binary data   (blob) }
  294.   fldDBBYTES         = $20A;            { Only for TEMPORARY tables }
  295.   fldDBLONG          = $20B;            { Long (Integer) }
  296.   fldDBDATETIME      = $20C;            { Time Stamp }
  297.   fldDBDOUBLE        = $20D;            { Double }
  298.   fldDBAUTOINC       = $20E;            { Auto increment (long) }
  299.  
  300. { xBASE key types (Cannot be used as field types) }
  301.  
  302.   fldDBKEYNUM        = $210;
  303.   fldDBKEYBCD        = $211;
  304.  
  305.  
  306. { Ascii types (Physical) }
  307.  
  308.   fldASCCHAR         = $301;            { Char string }
  309.   fldASCNUM          = $302;            { Number }
  310.   fldASCBOOL         = $303;            { Logical }
  311.   fldASCDATE         = $304;            { Date }
  312.   fldASCFLOAT        = $305;            { Float }
  313.   fldASCLOCK         = $306;            { Not used }
  314.   fldASCTIMESTAMP    = $307;            { TimeStamp }
  315.   fldASCTIME         = $308;            { Time }
  316.   fldASCLONG         = $309;            { Long }
  317.   fldASCMONEY        = $30A;            { Money }
  318.  
  319. { MS Access types (Physical) }
  320.  
  321.   fldACCCHAR         = $701;            { Fixed length Character }
  322.   fldACCVARCHAR      = $702;            { Variable length Character }
  323.   fldACCDATETIME     = $703;            { Date/Time }
  324.   fldACCBIT          = $704;            { Boolean }
  325.   fldACCMONEY        = $705;            { Currency }
  326.   fldACCSHORT        = $706;            { Short }
  327.   fldACCLONG         = $707;            { Long }
  328.   fldACCFLOAT        = $708;            { Float }
  329.   fldACCLONGTEXT     = $709;            { Memo }
  330.   fldACCLONGBINARY   = $70A;            { OLE Object }
  331.   fldACCAUTOINC      = $70B;            { Auto Number }
  332.   fldACCBYTE         = $70C;            { Byte }
  333.   fldACCDOUBLE       = $70D;            { Double }
  334.   fldACCBINARY       = $70E;            { Binary }
  335.  
  336.  
  337. {============================================================================}
  338. {                    Field descriptor                                        }
  339. {============================================================================}
  340.  
  341.  
  342. type
  343.   FLDVchk = (                           { Field Val Check type }
  344.     fldvNOCHECKS,                       { Does not have explicit val checks }
  345.     fldvHASCHECKS,                      { One or more val checks on the field }
  346.     fldvUNKNOWN                         { Dont know at this time }
  347.   );
  348.  
  349. type
  350.   FLDRights = (                         { Field Rights }
  351.     fldrREADWRITE,                      { Field can be Read/Written }
  352.     fldrREADONLY,                       { Field is Read only }
  353.     fldrNONE,                           { No Rights on this field }
  354.     fldrUNKNOWN                         { Dont know at this time }
  355.   );
  356.  
  357. type
  358.   pFLDDesc = ^FLDDesc;
  359.   FLDDesc = packed record               { Field Descriptor }
  360.     iFldNum         : Word;             { Field number (1..n) }
  361.     szName          : DBINAME;          { Field name }
  362.     iFldType        : Word;             { Field type }
  363.     iSubType        : Word;             { Field subtype (if applicable) }
  364.     iUnits1         : SmallInt;         { Number of Chars, digits etc }
  365.     iUnits2         : SmallInt;         { Decimal places etc. }
  366.     iOffset         : Word;             { Offset in the record (computed) }
  367.     iLen            : Word;             { Length in bytes (computed) }
  368.     iNullOffset     : Word;             { For Null bits (computed) }
  369.     efldvVchk       : FLDVchk;          { Field Has vcheck (computed) }
  370.     efldrRights     : FLDRights;        { Field Rights (computed) }
  371.     bCalcField      : WordBool;         { Is Calculated field (computed) }
  372.     iUnUsed         : packed array [0..1] of Word;
  373.   end;
  374.  
  375. { ============================================================================ }
  376. {                    Blob parameter descriptor                                 }
  377. { ============================================================================ }
  378.  
  379. type
  380.   pBLOBParamDesc = ^BLOBParamDesc;
  381.   BLOBParamDesc = packed record
  382.     pBlobBuffer     : Pointer;          { Blob buffer (client) }
  383.     ulBlobLen       : Integer;          { Length of the blob }
  384.     iUnUsed         : packed array[0..3] of Word;
  385.   end;
  386.  
  387. {============================================================================}
  388. {                    Index descriptor                                        }
  389. {============================================================================}
  390.  
  391. const
  392.   mdxDISTINCT      = $0020;         { OR with bUnique for dBASE distinct tags }
  393.  
  394. type
  395.   pIDXDesc = ^IDXDesc;
  396.   IDXDesc = packed record               { Index description }
  397.     szName          : DBITBLNAME;       { Index name }
  398.     iIndexId        : Word;             { Index number }
  399.     szTagName       : DBINAME;          { Tag name (for dBASE) }
  400.     szFormat        : DBINAME;          { Optional format (BTREE, HASH etc) }
  401.     bPrimary        : WordBool;         { True, if primary index }
  402.     bUnique         : WordBool;         { True, if unique keys (TRI-STATE for dBASE) }
  403.     bDescending     : WordBool;         { True, for descending index }
  404.     bMaintained     : WordBool;         { True, if maintained index }
  405.     bSubset         : WordBool;         { True, if subset index }
  406.     bExpIdx         : WordBool;         { True, if expression index }
  407.     iCost           : Word;             { Not used }
  408.     iFldsInKey      : Word;             { Fields in the key (1 for Exp) }
  409.     iKeyLen         : Word;             { Phy Key length in bytes (Key only) }
  410.     bOutofDate      : WordBool;         { True, if index out of date }
  411.     iKeyExpType     : Word;             { Key type of Expression }
  412.     aiKeyFld        : DBIKEY;           { Array of field numbers in key }
  413.     szKeyExp        : DBIKEYEXP;        { Key expression }
  414.     szKeyCond       : DBIKEYEXP;        { Subset condition }
  415.     bCaseInsensitive : WordBool;        { True, if case insensitive index }
  416.     iBlockSize      : Word;             { Block size in bytes }
  417.     iRestrNum       : Word;             { Restructure number }
  418.     abDescending    : packed array [0..DBIMAXFLDSINKEY-1] of WordBool; { TRUE }
  419.     iUnUsed         : packed array [0..15] of Word;
  420.   end;
  421.  
  422. {============================================================================}
  423. {             Validity check, Referential integrity descriptors              }
  424. {============================================================================}
  425.  
  426.  
  427.  
  428. { Subtypes for Lookup }
  429.  
  430.   LKUPType = (                          { Paradox Lookup type }
  431.     lkupNONE,                           { Has no lookup }
  432.     lkupPRIVATE,                        { Just Current Field + Private }
  433.     lkupALLCORRESP,                     { All Corresponding + No Help }
  434.     lkupHELP,                           { Just Current Fld + Help and Fill }
  435.     lkupALLCORRESPHELP                  { All Corresponging + Help }
  436.   );
  437.  
  438. const
  439.   TODAYVAL           = 2;               { for Min/Max/Def val flags }
  440.   NOWVAL             = 3;               { for Min/Max/Def val flags }
  441.  
  442.    { In VCHKDesc below, if any of bHasMinVal/bHasMaxVal/bHasDefVal }
  443.    { = TODAYVAL, then TODAY is assumed , = NOWVAL, then current time/today is assumed }
  444.  
  445. type
  446.   pVCHKDesc = ^VCHKDesc;
  447.   VCHKDesc = packed record              { Val Check structure }
  448.     iFldNum         : Word;             { Field number }
  449.     bRequired       : WordBool;         { If True, value is required }
  450.     bHasMinVal      : WordBool;         { If True, has min value }
  451.     bHasMaxVal      : WordBool;         { If True, has max value }
  452.     bHasDefVal      : WordBool;         { If True, has default value }
  453.     aMinVal         : DBIVCHK;          { Min Value }
  454.     aMaxVal         : DBIVCHK;          { Max Value }
  455.     aDefVal         : DBIVCHK;          { Default value }
  456.     szPict          : DBIPICT;          { Picture string }
  457.     elkupType       : LKUPType;         { Lookup/Fill type }
  458.     szLkupTblName   : DBIPATH;          { Lookup Table name }
  459.   end;
  460.  
  461.   RINTType = (                          { Ref integrity type }
  462.     rintMASTER,                         { This table is Master }
  463.     rintDEPENDENT                       { This table is Dependent }
  464.   );
  465.  
  466.   RINTQual = (                          { Ref integrity action/qualifier }
  467.     rintRESTRICT,                       { Prohibit operation }
  468.     rintCASCADE                         { Cascade operation }
  469.   );
  470.  
  471.   pRINTDesc = ^RINTDesc;
  472.   RINTDesc = packed record              { Ref Integrity Desc }
  473.     iRintNum        : Word;             { Ref integrity number }
  474.     szRintName      : DBINAME;          { A name to tag this integegrity constraint }
  475.     eType           : RINTType;         { Whether master/dependent }
  476.     szTblName       : DBIPATH;          { Other table name }
  477.     eModOp          : RINTQual;         { Modify qualifier }
  478.     eDelOp          : RINTQual;         { Delete qualifier }
  479.     iFldCount       : Word;             { Fields in foreign key }
  480.     aiThisTabFld    : DBIKEY;           { Fields in this table }
  481.     aiOthTabFld     : DBIKEY;           { Fields in other table }
  482.   end;
  483.  
  484.  
  485. {============================================================================}
  486. {                    Security descriptor                                     }
  487. {============================================================================}
  488. { Family rights }
  489.  
  490. const
  491.   NOFAMRIGHTS        = $00;             { No Family rights }
  492.   FORMRIGHTS         = $01;             { Can change form }
  493.   RPTRIGHTS          = $02;             { Can change reports }
  494.   VALRIGHTS          = $04;             { Can change valchecks }
  495.   SETRIGHTS          = $08;             { Can change settings }
  496.   ALLFAMRIGHTS       = (FORMRIGHTS or RPTRIGHTS or VALRIGHTS or SETRIGHTS);
  497.                                              { All family rights }
  498.  
  499. type
  500.   PRVType = TypedEnum;
  501. const
  502.     prvNONE      = 0;                   { No privilege }
  503.     prvREADONLY  = 1;                   { Read only Table or Field }
  504.     prvMODIFY    = 3;                   { Read and Modify fields (non-key) }
  505.     prvINSERT    = 7;                   { Insert + All of above }
  506.     prvINSDEL    = $0F;                 { Delete + All of above }
  507.     prvFULL      = $1F;                 { Full Writes }
  508.     prvUNKNOWN   = $FF;                 { Unknown }
  509.  
  510. type
  511.   pSECDesc = ^SECDesc;
  512.   SECDesc = packed record               { Security description }
  513.     iSecNum         : Word;             { Nbr to identify desc }
  514.     eprvTable       : PrvType;          { Table privileges }
  515.     iFamRights      : Word;             { Family rights }
  516.     szPassword      : DBINAME;          { Null terminated string }
  517.     aprvFld         : packed array [0..DBIMAXFLDSINSEC-1] of PrvType;
  518.                      { Field level privileges (prvNONE/prvREADONLY/prvFULL) }
  519.   end;
  520.  
  521. {============================================================================}
  522. {                            Miscellaneous                                   }
  523. {============================================================================}
  524.  
  525. { Index Id used to open table without a default index (i.e. no order) }
  526.  
  527. const
  528.   NODEFAULTINDEX     = $FFFF;
  529.  
  530.  
  531. {============================================================================}
  532. {                    Object types                                            }
  533. {============================================================================}
  534.  
  535. type
  536.   DBIOBJType = (
  537.     objFILLER,                          { Filler to make next start at 1 }
  538.     objSYSTEM,                          { System object }
  539.     objSESSION,                         { Session object }
  540.     objDRIVER,                          { Driver object }
  541.     objDATABASE,                        { Database object }
  542.     objCURSOR,                          { Cursor object }
  543.     objSTATEMENT,                       { Statement object }
  544.     objCLIENT,                          { Client object }
  545.     objDBSEC,                           { DbSystem object (dBASE only) }
  546.     objREPOSITORY                       { Data Repository object }
  547.   );
  548.  
  549. {============================================================================}
  550. {                    Cursor properties                                       }
  551. {============================================================================}
  552.  
  553. type
  554.   DBIShareMode = (                      { Database/Table Share type }
  555.     dbiOPENSHARED,                      { Open shared  (Default) }
  556.     dbiOPENEXCL                         { Open exclusive }
  557.   );
  558.  
  559.   DBIOpenMode = (                       { Database/Table Access type }
  560.     dbiREADWRITE,                       { Read + Write   (Default) }
  561.     dbiREADONLY                         { Read only }
  562.   );
  563.  
  564.   DBILockType = (                       { Lock types (Table level) }
  565.     dbiNOLOCK,                          { No lock   (Default) }
  566.     dbiWRITELOCK,                       { Write lock }
  567.     dbiREADLOCK                         { Read lock }
  568.   );
  569.  
  570.   XLTMode = (                           { Field translate mode }
  571.     xltNONE,                            { No translation  (Physical Types) }
  572.     xltRECORD,                          { Record level translation (not supported) }
  573.     xltFIELD                            { Field level translation (Logical types) }
  574.   );
  575.  
  576.   UPDLockMode = (                       { Update lock mode (SQL only) }
  577.     updWHEREALL,                        { All fields in WHERE clause }
  578.     updWHEREKEYCHG,                     { Keyed and changed fields in WHERE clause }
  579.     updWHEREKEY                         { Keyed fields in WHERE clause }
  580.   );
  581.  
  582. { Table levels }
  583.  
  584. const
  585.   TBLLEVEL3          = 3;               { Paradox level 3 and dBASE level 3+ }
  586.   TBLLEVEL4          = 4;               { Paradox level 4 and dBASE level 4 }
  587.   TBLLEVEL5          = 5;               { Paradox level 5 and dBASE/Win }
  588.   TBLLEVEL6          = 6;               { dBASE level 6 }
  589.   TBLLEVEL7          = 7;               { Paradox level 7 , Win32 }
  590.   FOXLEVEL25         = 25;              { Fox Table (Ver 2.5) }
  591.  
  592. type
  593.   pCURProps = ^CURProps;
  594.   CURProps = packed record              { Virtual Table properties }
  595.     szName          : DBITBLNAME;       { table name (no extension, if it can be derived) }
  596.     iFNameSize      : Word;             { Full file name size }
  597.     szTableType     : DBINAME;          { Driver type }
  598.     iFields         : Word;             { No of fields in Table }
  599.     iRecSize        : Word;             { Record size (logical record) }
  600.     iRecBufSize     : Word;             { Record size (physical record) }
  601.     iKeySize        : Word;             { Key size }
  602.     iIndexes        : Word;             { Number of indexes }
  603.     iValChecks      : Word;             { Number of val checks }
  604.     iRefIntChecks   : Word;             { Number of Ref Integrity constraints }
  605.     iBookMarkSize   : Word;             { Bookmark size }
  606.     bBookMarkStable : WordBool;         { Stable book marks }
  607.     eOpenMode       : DBIOpenMode;      { ReadOnly / RW }
  608.     eShareMode      : DBIShareMode;     { Excl / Share }
  609.     bIndexed        : WordBool;         { Index is in use }
  610.     iSeqNums        : SmallInt;         { 1: Has Seqnums; 0: Has Record# }
  611.     bSoftDeletes    : WordBool;         { Supports soft deletes }
  612.     bDeletedOn      : WordBool;         { If above, deleted recs seen }
  613.     iRefRange       : Word;             { Not used }
  614.     exltMode        : XLTMode;          { Translate Mode }
  615.     iRestrVersion   : Word;             { Restructure version number }
  616.     bUniDirectional : WordBool;         { Cursor is uni-directional }
  617.     eprvRights      : Word;             { Table  rights }
  618.     Dummy4          : Word;
  619.     iFmlRights      : Word;             { Family rights }
  620.     iPasswords      : Word;             { Number of Aux passwords }
  621.     iCodePage       : Word;             { Codepage (0 if unknown) }
  622.     bProtected      : WordBool;         { Table is protected by password }
  623.     iTblLevel       : Word;             { Driver dependent table level }
  624.     szLangDriver    : DBINAME;          { Language driver name }
  625.     bFieldMap       : WordBool;         { Field map active }
  626.     iBlockSize      : Word;             { Physical file blocksize in K }
  627.     bStrictRefInt   : WordBool;         { Strict referential integrity }
  628.     iFilters        : Word;             { Number of filters }
  629.     bTempTable      : WordBool;         { Table is a temporary table }
  630.     iUnUsed         : packed array [0..15] of Word;
  631.   end;
  632.  
  633. { Delayed Update Types and Constants }
  634.  
  635. type
  636.   DBIDelayedUpdCmd = (                  { Op types for Delayed Update cursor }
  637.     dbiDelayedUpdCommit,                { Commit the updates }
  638.     dbiDelayedUpdCancel,                { Rollback the updates }
  639.     dbiDelayedUpdCancelCurrent,         { Cancel the Current Rec Change }
  640.     dbiDelayedUpdPrepare                { Phase1 of 2 phase commit }
  641.   );
  642.  
  643. const
  644.   DBIDELAYUPD_SHOWMODIFYBIT    = $1;    { Show only modified records. }
  645.   DBIDELAYUPD_SHOWINSERTBIT    = $2;    { Show only inserted records. }
  646.   DBIDELAYUPD_SHOWDELETEBIT    = $4;    { Show only deleted records. }
  647.   DBIDELAYUPD_SHOWNONMODIFYBIT = $8;    { Show only unmodified recs. }
  648.  
  649. {============================================================================}
  650. {                   Record Properties                                        }
  651. {============================================================================}
  652.  
  653. type
  654.   pRECProps = ^RECProps;
  655.   RECProps = packed record              { Record properties }
  656.     iSeqNum         : Longint;          { When Seq# supported only }
  657.     iPhyRecNum      : Longint;          { When Phy Rec#s supported only }
  658.     iRecStatus      : Word;             { Delayed Updates Record Status }
  659.     bSeqNumChanged  : WordBool;         { Not used }
  660.     bDeleteFlag     : WordBool;         { When soft delete supported only }
  661.   end;
  662.  
  663.  
  664. {============================================================================}
  665. {                   General properties  DbiGetProp/DbiSetProp                }
  666. {============================================================================}
  667.  
  668.  
  669. { Cursor properties }
  670. { General           }
  671.  
  672. const
  673.   curMAXPROPS        = $00050000;       { ro UINT16   , Number of defined properties }
  674.   curTABLENAME       = $00050001;       { ro pTBLNAME , Table name }
  675.   curTABLETYPE       = $00050002;       { ro pDBINAME , Table type }
  676.   curTABLELEVEL      = $00050003;       { ro UINT16   , Table level 1..n }
  677.   curFILENAME        = $00050004;       { ro pPATH    , Full filename }
  678.   curXLTMODE         = $00050005;       { rw XLTMode  , Translate mode }
  679.   curSEQREADON       = $00050006;       { rw BOOL     , Sequential read mode hint ON }
  680.   curONEPASSON       = $00050007;       { rw BOOL     , One pass mode hint ON }
  681.   curUPDATETS        = $00050008;       { ro TIMESTAMP, Update timestamp }
  682.   curSOFTDELETEON    = $00050009;       { rw BOOL     , Softdelete ON }
  683.   curLANGDRVNAME     = $0005000A;       { ro pCHAR    , Symbolic language drv. name }
  684.   curCURSORNAME      = $0005000B;       { ro pCHAR    , name of the cursor }
  685.   maxcurPROPS        = 11;              { keep in sync when adding cursor properties }
  686.  
  687. { Paradox specific }
  688.   curPDXMAXPROPS     = $01050000;       { ro UINT16   , Number of defined properties }
  689.   maxcurPDXPROPS     = 0;
  690.  
  691. { DBase specific }
  692.   curDBMAXPROPS      = $02050000;       { ro UINT16   , Number of defined properties }
  693.   curINEXACTON       = $02050001;       { rw BOOL     , InExact match ON }
  694.   curSHAREMODE       = $02050002;       { rw DBIShareMode, Share mode }
  695.   maxcurDBPROPS      = 2;
  696.  
  697. { Text Driver specific }
  698.   curDELIMITALLFLDS  = $03050000;       { rw BOOL , Delimit all fields. }
  699.   curUSESCHEMAFILE   = $03050001;       { rw BOOL , read schema from a file }
  700.  
  701. { SQL Driver specific }
  702.   curUPDLOCKMODE     = $04050000;       { rw UPDLockMode, Update lock mode }
  703.   curNATIVEHNDL      = $04050001;       { ro pBYTE, Native cursor handle }
  704.   curMAXROWS         = $04050002;       { rw INT32, Max rows to fetch from server }
  705.   curGETEXTENDEDINFO = $04050003;       { rw BOOL, Get RINT info etc. }
  706.   curGETHIDDENCOLUMNS= $04050004;       { rw BOOL , Get all selected columns from server. }
  707.   curCONSTSTATE      = $0405009B;       { rw BOOL, enable/disable constraints }
  708.  
  709. { Delayed Updates Specific. }
  710.   curDELAYUPDRECSTATE     = $05050001;  { ro DELYUPDCbDesc }
  711.   curDELAYUPDABORTRESTORE = $05050002;  { rw BOOL, restore state }
  712.                                         {  when commit is aborted. }
  713.   curDELAYUPDDISPLAYOPT   = $05050003;  { rw UINT16, view records }
  714.                                         {  with specific update status }
  715.   curDELAYUPDGETOLDRECORD = $05050004;  { rw BOOL, get un-modified }
  716.                                         {  rec buf for modified recs }
  717.   curDELAYUPDNUMUPDATES   = $05050005;  { ro INT32, num of updates }
  718.   curDELAYUPDUSECALLBACK  = $05050006;  { rw BOOL, callback usr. }
  719.  
  720. { Driver properties }
  721. { General           }
  722.   drvMAXPROPS        = $00030000;       { ro UINT16   , Number of defined properties }
  723.   drvDRIVERTYPE      = $00030002;       { ro pDBINAME , Driver type }
  724.   drvDRIVERVERSION   = $00030003;       { ro UINT16   , Driver version }
  725.   maxdrvPROPS        = 2;               { keep in sync when adding driver properties }
  726.  
  727. { SQL Driver specific }
  728.   drvNATIVESQLCA     = $00030004;       { ro pBYTE    , Native SQLCA structure (Informix) }
  729.  
  730. { Database properties }
  731. { General             }
  732.   dbMAXPROPS         = $00040000;       { ro UINT16   , Number of defined properties }
  733.   dbDATABASENAME     = $00040001;       { ro pDBINAME , Database name/alias }
  734.   dbDATABASETYPE     = $00040002;       { ro pDBINAME , Database type }
  735.   dbDEFAULTDRIVER    = $00040003;       { rw pDBINAME , Default Driver name }
  736.   dbPARAMFMTQMARK    = $00040004;       { rw BOOL     , Stmt param marker fmt = ? }
  737.   dbUSESCHEMAFILE    = $00040005;       { rw BOOL , for text driver only. }
  738.   maxdbPROPS         = 22;              { keep in sync when adding ANY db properties }
  739.  
  740. { SQL Driver specific }
  741.   dbASYNCSUPPORT     = $04040000;       { ro BOOL     , Async. qry exec support }
  742.   dbPROCEDURES       = $04040001;       { ro BOOL     , Stored procedure support }
  743.   dbDEFAULTTXNISO    = $04040002;       { ro eXILType , Default transaction iso level }
  744.   dbNATIVEHNDL       = $04040003;       { ro pBYTE    , Native connection handle }
  745.   dbNATIVEPASSTHRUHNDL = $04040004;     { ro pBYTE    , Native passthru connection handle }
  746.   dbSERVERVERSION    = $04040005;       { ro UINT16   , Major server version number }
  747.   dbBATCHCOUNT       = $04040006;       { rw UINT16   , Batch modification count before auto-commit }
  748.   dbTRACEMODE        = $04040007;       { rw UINT16   , Trace mode }
  749.   dbCURRENTUSERNAME  = $04040008;       { rw UINT16   , Current User Name }
  750.   dbOWNERQUALIFIED   = $04040009;       { ro BOOL     , For SQL Link Drivers - does this driver support }
  751.   dbQUOTECHAR        = $0404000A;       { ro CHAR     , Quote character for quoting Object Names }
  752.   dbONLINE           = $0404000B;       { ro BOOL     , Informix ONLINE }
  753.   dbTRANALLOWED      = $0404000C;       { ro BOOL     , Informix Transactions allowed. }
  754.   dbANSI             = $0404000D;       { ro BOOL     , Informix Ansi complaint database. }
  755.   dbDBMSNAME         = $0404000E;       { ro pDBINAME , DB2 specific Database (OS/2 or MVS or AS/400). }
  756.   dbBLOBCOUNT        = $0404000F;       { ro UINT16, No.of dead BLOB to cache. }
  757.   dbBLOBSIZE         = $04040010;       { ro UINT16, Dead BLOB fetch buffer size. }
  758.  
  759.   dbSCHEMACACHEENABLED = $04040099;     { w BOOL     , TRUE - enabled/FALSE - disabled }
  760.   dbBCDENABLED       = $0404009A;       { rw BOOL , enable BCD field types. }
  761.  
  762. { Session properties }
  763. { General            }
  764.   sesMAXPROPS        = $00020000;       { ro UINT16   , Number of defined properties }
  765.   sesSESSIONNAME     = $00020001;       { ro pDBINAME , Name of seesion }
  766.   sesNETFILE         = $00020002;       { rw pCHAR    , Full filename of netfile (MAXPATHLEN) }
  767.   sesCFGMODE         = $00020003;       { rw CFGMode, Mode of configuration file. }
  768.   sesDEFAULTDRIVER   = $00020004;       { rw pDBINAME, default driver name }
  769.   sesGROUPNAME       = $00020005;       { rw pCHAR, Security - user group name (dBASE) }
  770.   sesUSERNAME        = $00020006;       { rw pCHAR, User Name }
  771.   sesUSERPASSWORD    = $00020007;       { rw pCHAR, User password }
  772.   sesSECFILENAME     = $00020008;       { rw pCHAR, Location of dBASE Security file }
  773.   sesDRNAME          = $00020009;       { rw pCHAR, Repository Database Name }
  774.   sesCFGUPDATE       = $0002000A;       { rw CFGUpdate, Mode for updating session configuration }
  775.   sesCFGNAME         = $0002000B;       { ro CFGName, get session configuration name }
  776.   sesCFGMODE2        = $0002000C;       { rw new CFGMode (persist, session, virtual) }
  777.   maxsesPROPS        = 12;              { keep in sync when adding session properties }
  778.  
  779. { System properties }
  780. { General           }
  781.   sysMAXPROPS        = $00010000;       { ro UINT16  , Number of defined properties }
  782.   sysLOWMEMUSAGE     = $00010001;       { ro UINT16  , Low memory usage in (k) }
  783.   maxsysPROPS        = 1;               { keep in sync when adding system properties }
  784.  
  785. { Statement properties }
  786. { General              }
  787.   stmtMAXPROPS       = $00060001;       { ro UINT16      Number of defined properties }
  788.   stmtPARAMETERCOUNT = $00060002;       { ro UINT16      Count of parameters }
  789.   stmtPARAMETERDESCS = $00060003;       { ro aFLDDesc    Array of parameters }
  790.   stmtLANGDRVNAME    = $00060004;       { ro pCHAR       Symbolic language drv. name }
  791.   stmtUNIDIRECTIONAL = $00060010;       { rw BOOL        Cursor Unidirectional }
  792.   stmtCURSORNAME     = $00060011;       { rw pCHAR       Cursor name }
  793.   stmtNEWCONNECT     = $00060012;       { rw BOOL        Stmt on new connection }
  794.   stmtNATIVEHNDL     = $00060013;       { ro pBYTE       Native statement handle }
  795.   stmtROWCOUNT       = $00060014;       { ro UINT32      Rows effected by a stmt }
  796.   stmtEXECASCURSOR   = $00060015;       { rw BOOL        Open a server cursor (ct-lib) }
  797.   maxstmtPROPS       = 32;              { keep in sync when adding ANY stmt properties }
  798.  
  799. { specific to QBE or local SQL }
  800.   stmtANSTYPE        = $00060020;       { rw pBYTE       Table Type of Answer set }
  801.   stmtLIVENESS       = $00060021;       { rw LIVENESS    Preference for canned/live answers }
  802.   stmtQRYMODE        = $00060022;       { rw QryEvalMode Execute on server or local or either }
  803.   stmtBLANKS         = $00060023;       { rw BOOL        True if blanks to be regarded as zeros. }
  804.   stmtDATEFORMAT     = $00060024;       { rw FMTDate     Date format }
  805.   stmtNUMBERFORMAT   = $00060025;       { rw FMTNumber   Number format }
  806.   stmtAUXTBLS        = $00060026;       { rw BOOL        True if QBE to create CHANGED, etc. }
  807.   stmtTBLVECTOR      = $00060027;       { ro UINT16      Vector of tables generated by query. }
  808.   stmtALLPROPS       = $00060028;       { rw QueryLowProps }
  809.   stmtALLPROPSSIZE   = $00060029;       { rw INT16       size of QueryLowProps }
  810.   stmtANSNAME        = $00060030;       { rw pBYTE       Answer Table Name. }
  811.   stmtCONSTRAINED    = $00060031;       { rw BOOL        Constrain input }
  812.   stmtFIELDDESCS     = $00060032;       { rw pFLDDESC    Answer FieldDescs }
  813.   stmtCURPROPS       = $00060033;       { rw pCURProps    Answer Curprops }
  814.   stmtDEFDBNAME      = $00060034;       { rw pCURProps    Answer Curprops }
  815.   stmtXLTMODE        = $00060035;       { rw XLTMode      Xltmode }
  816.   stmtINSTBLNAME     = $00060036;       { ro DBITBLNAME  INSERT table's name }
  817.   stmtINSERRTBLNAME  = $00060037;       { ro DBITBLNAME  ERRINS table's name }
  818.   stmtUPDTBLNAME     = $00060038;       { ro DBITBLNAME  UPDATE table's name }
  819.   stmtUPDERRTBLNAME  = $00060039;       { ro DBITBLNAME  ERRUPD table's name }
  820.   stmtDELTBLNAME     = $00060040;       { ro DBITBLNAME  DELETED table's name }
  821.   stmtDELERRTBLNAME  = $00060041;       { ro DBITBLNAME  ERRDEL table's name }
  822.   stmtCANNEDREADONLY = $00060042;       { rw BOOL canned answers are readonly }
  823.  
  824.  
  825. {============================================================================}
  826. {                    Transactions                                            }
  827. {============================================================================}
  828.  
  829. { Transaction support }
  830.  
  831. type
  832.   eXILType = (                          { Transaction isolation levels }
  833.     xilDIRTYREAD,                       { Uncommitted changes read }
  834.     xilREADCOMMITTED,                   { Committed changes, no phantoms }
  835.     xilREPEATABLEREAD                   { Full read repeatability }
  836.   );
  837.  
  838.   eXEnd = (                             { Transaction end control }
  839.     xendCOMMIT,                         { Commit transaction }
  840.     xendCOMMITKEEP,                     { Commit transaction, keep cursors }
  841.     xendABORT                           { Rollback transaction }
  842.   );
  843.  
  844.   eXState = (                           { Transaction end control }
  845.     xsINACTIVE,                         { Transaction inactive }
  846.     xsACTIVE                            { Transaction active }
  847.   );
  848.  
  849. type
  850.   pXInfo = ^XInfo;
  851.   XInfo = packed record
  852.     exState         : eXState;          { xsActive, xsInactive }
  853.     eXIL            : eXILType;         { Xact isolation level }
  854.     uNests          : Word;             { Xact children }
  855.   end;
  856.  
  857.  
  858. {============================================================================}
  859. {                         BookMark compares                                  }
  860. {============================================================================}
  861.  
  862. type
  863.   PCMPBkMkRslt = ^CMPBkMkRslt;
  864.   CMPBkMkRslt = TypedEnum;
  865. const
  866.     CMPLess           = -1;             { Bkm1 < Bkm2 }
  867.     CMPEql            = 0;              { BookMarks are exactly the same }
  868.     CMPGtr            = 1;              { Bkm1 > Bkm2 }
  869.     CMPKeyEql         = 2;              { Only Bkm1.key_val = Bkm2.key_val }
  870.  
  871. {============================================================================}
  872. {                             Key searches                                   }
  873. {============================================================================}
  874.  
  875. type
  876.   DBISearchCond = (                     { Search condition for keys }
  877.     keySEARCHEQ,                        { = }
  878.     keySEARCHGT,                        { > }
  879.     keySEARCHGEQ                        { >= }
  880.   );
  881.  
  882. {============================================================================}
  883. {                      Create/Restructure descriptor                         }
  884. {============================================================================}
  885.  
  886. type
  887.   pCROpType          = ^CROpType;
  888.   CROpType = (                          { Create/Restruct Operation type }
  889.     crNOOP,
  890.     crADD,                              { Add a new element. }
  891.     crCOPY,                             { Copy an existing element. }
  892.     crMODIFY,                           { Modify an element. }
  893.     crDROP,                             { Removes an element. }
  894.     crREDO,                             { Reconstruct an element. }
  895.     crTABLE,                            { Not used }
  896.     crGROUP,                            { Not used }
  897.     crFAMILY,                           { Not used }
  898.     crDONE,                             { Used internally }
  899.     crDROPADD                           { Used internally }
  900.   );
  901.  
  902. type
  903.   pCRTblDesc         = ^CRTblDesc;
  904.   CRTblDesc = packed record             { Create/Restruct Table descr }
  905.     szTblName       : DBITBLNAME;       { TableName incl. optional path & ext }
  906.     szTblType       : DBINAME;          { Driver type (optional) }
  907.     szErrTblName    : DBIPATH;          { Error Table name (optional) }
  908.     szUserName      : DBINAME;          { User name (if applicable) }
  909.     szPassword      : DBINAME;          { Password (optional) }
  910.     bProtected      : WordBool;         { Master password supplied in szPassword }
  911.     bPack           : WordBool;         { Pack table (restructure only) }
  912.     iFldCount       : Word;             { Number of field defs supplied }
  913.     pecrFldOp       : pCROpType;        { Array of field ops }
  914.     pfldDesc        : pFLDDesc;         { Array of field descriptors }
  915.     iIdxCount       : Word;             { Number of index defs supplied }
  916.     pecrIdxOp       : pCROpType;        { Array of index ops }
  917.     pidxDesc        : PIDXDesc;         { Array of index descriptors }
  918.     iSecRecCount    : Word;             { Number of security defs supplied }
  919.     pecrSecOp       : pCROpType;        { Array of security ops }
  920.     psecDesc        : pSECDesc;         { Array of security descriptors }
  921.     iValChkCount    : Word;             { Number of val checks }
  922.     pecrValChkOp    : pCROpType;        { Array of val check ops }
  923.     pvchkDesc       : pVCHKDesc;        { Array of val check descs }
  924.     iRintCount      : Word;             { Number of ref int specs }
  925.     pecrRintOp      : pCROpType;        { Array of ref int ops }
  926.     printDesc       : pRINTDesc;        { Array of ref int specs }
  927.     iOptParams      : Word;             { Number of optional parameters }
  928.     pfldOptParams   : pFLDDesc;         { Array of field descriptors }
  929.     pOptData        : Pointer;          { Optional parameters }
  930.   end;
  931.  
  932. {============================================================================}
  933. {                      Batch                                                 }
  934. {============================================================================}
  935.  
  936. type
  937.   pBATTblDesc        = ^BATTblDesc;
  938.   BATTblDesc = packed record            { Batch Table definition struct }
  939.     hDb             : hDBIDb;           { Database }
  940.     szTblName       : DBIPATH;          { Table name }
  941.     szTblType       : DBINAME;          { Optional Driver type }
  942.     szUserName      : DBINAME;          { Optional User name }
  943.     szPassword      : DBINAME;          { Optional Pass word }
  944.   end;
  945.  
  946.   eBATMode = (                          { Batch mode for DBIBatchMove }
  947.     batchAPPEND,
  948.     batchUPDATE,
  949.     batchAPPENDUPDATE,
  950.     batchSUBTRACT,
  951.     batchCOPY
  952.   );
  953.  
  954. type
  955.   pSORTOrder         = ^SORTOrder;
  956.   SORTOrder = (                         { Sort Order }
  957.     sortASCEND,                         { ascending (default) }
  958.     sortDESCEND                         { descending }
  959.   );
  960.  
  961.   ppfSORTCompFn = ^pfSORTCompFn;
  962.   pfSORTCompFn = function (             { pntr to client compare fn }
  963. var   LdObj         : Pointer;          { Language driver, if needed }
  964. var   Value1        : Pointer;          { first value }
  965. var   Value2        : Pointer;          { second value }
  966.       iLen          : SmallInt              { Length, if needed }
  967.    ): SmallInt;
  968.  
  969.       { Returns: -1 if (Value 1 < Value 2),  }
  970.       {           0 if (Value 1 == Value 2), }
  971.       {          +1 if (Value 1 > Value 2)   }
  972.  
  973. {============================================================================}
  974. {                       Types/Structs for Capabilities                       }
  975. {============================================================================}
  976.  
  977. type
  978.   DRVCat = (                            { Driver Category }
  979.     drvFILLER,                          { Filler to make next start at 1 }
  980.     drvFILE,                            { File based (Paradox, xBASE) }
  981.     drvOTHERSERVER,                     { Other kind of server (IMS ?) }
  982.     drvSQLBASEDSERVER,                  { SQL Based Server }
  983.     drvOLEDBPROVIDER                    { OLE DB Provider }
  984.   );
  985.  
  986.   OPType = (                            { Config info & Optional Parameters }
  987.     opFILLER0,                          { Filler to make first one 3 }
  988.     opFILLER1,                          { Filler to make first one 3 }
  989.     opFILLER2,                          { Filler to make first one 3 }
  990.     opDBCREATE,
  991.     opDBOPEN,
  992.     opTBLCREATE,
  993.     opTBLOPEN
  994.   );
  995.  
  996. type
  997.   pDRVType = ^DRVType;
  998.   DRVType = packed record               { Driver Description/Capabilities }
  999.     szType          : DBINAME;          { Symbolic name to identify }
  1000.     szText          : DBINAME;          { Descriptive text }
  1001.     edrvCat         : DRVCat;           { Driver category }
  1002.     bTrueDb         : WordBool;         { Supports True Db concept }
  1003.     szDbType        : DBINAME;          { Db Type to be used }
  1004.     bMultiUser      : WordBool;         { Supports Multi-user access }
  1005.     bReadWrite      : WordBool;         { Read Write or Read-only }
  1006.     bTrans          : WordBool;         { Supports Transactions }
  1007.     bPassThruSQL    : WordBool;         { Supports Pass-thru SQL }
  1008.     bLogIn          : WordBool;         { Requires explicit login }
  1009.     bCreateDb       : WordBool;         { Can reate a Database }
  1010.     bDeleteDb       : WordBool;         { Can drop database }
  1011.     bCreateTable    : WordBool;         { Can create a Table }
  1012.     bDeleteTable    : WordBool;         { Can delete a Table }
  1013.     bMultiplePWs    : WordBool;         { Multiple passwords }
  1014.     iDriverVersion  : Word;             { Driver version 1..n }
  1015.     bSQLRowid       : WordBool;         { Supports SQL rowid }
  1016.     iUnUsed         : packed array [0..14] of Word;
  1017.   end;
  1018.  
  1019.  
  1020.   pTBLType = ^TBLType;
  1021.   TBLType = packed record               { Table Capabilities }
  1022.     iId             : Word;             { Id of Table Type }
  1023.     szName          : DBINAME;          { Symbolic name; eg "dBASE" }
  1024.     szText          : DBINAME;          { Descriptive text }
  1025.     szFormat        : DBINAME;          { Format; eg "HEAP" }
  1026.     bReadWrite      : WordBool;         { User can Read/Write }
  1027.     bCreate         : WordBool;         { Can create new tables }
  1028.     bRestructure    : WordBool;         { Can restructure this table }
  1029.     bValChecks      : WordBool;         { Val Checks can be specified }
  1030.     bSecurity       : WordBool;         { Can be protected }
  1031.     bRefIntegrity   : WordBool;         { Can participate in ref integrity }
  1032.     bPrimaryKey     : WordBool;         { Supports primary key concept }
  1033.     bIndexing       : WordBool;         { Can have other indexes }
  1034.     iFldTypes       : Word;             { Number of Phy Field types supported }
  1035.     iMaxRecSize     : Word;             { Max record size }
  1036.     iMaxFldsInTable : Word;             { Max fields in a table }
  1037.     iMaxFldNameLen  : Word;             { Maximum field name length }
  1038.     iTblLevel       : Word;             { Driver dependent table level (version) }
  1039.     iUnUsed         : packed array [0..15] of Word;
  1040.   end;
  1041.  
  1042.  
  1043.   pIDXType = ^IDXType;
  1044.   IDXType = packed record
  1045.     iId             : Word;             { Id of Index Type }
  1046.     szName          : DBINAME;          { Symbolic name }
  1047.     szText          : DBINAME;          { Descriptive text }
  1048.     szFormat        : DBINAME;          { Optional format(BTREE, HASH etc) }
  1049.     bComposite      : WordBool;         { Supports composite keys }
  1050.     bPrimary        : WordBool;         { True, if primary index }
  1051.     bUnique         : WordBool;         { True, No duplicates supported }
  1052.     bKeyDescending  : WordBool;         { If whole key can be descending }
  1053.     bFldDescending  : WordBool;         { Field level descending }
  1054.     bMaintained     : WordBool;         { Supports maintained option }
  1055.     bSubset         : WordBool;         { Supports Subset expression }
  1056.     bKeyExpr        : WordBool;         { If Key can be expres }
  1057.     bCaseInsensitive : WordBool;        { Supports Caseinsensitive indexes }
  1058.     iUnUsed         : packed array [0..15] of Word;
  1059.   end;
  1060.  
  1061.   pFLDType = ^FLDType;
  1062.   FLDType = packed record
  1063.     iId             : Word;             { Id of Field Type }
  1064.     szName          : DBINAME;          { Symbolic name; eg "ALPHA" }
  1065.     szText          : DBINAME;          { Descriptive text }
  1066.     iPhyType        : Word;             { Physical/Native type }
  1067.     iXltType        : Word;             { Default xlated type }
  1068.     iXltSubType     : Word;             { Default xlated sub type }
  1069.     iMaxUnits1      : Word;             { Max units allowed (1) }
  1070.     iMaxUnits2      : Word;             { Max units allowed (2) }
  1071.     iPhySize        : Word;             { Physical size in bytes (per unit) }
  1072.     bRequired       : WordBool;         { Supports 'required' option }
  1073.     bDefaultVal     : WordBool;         { Supports user specified 'default' }
  1074.     bMinVal         : WordBool;         { Supports MIN Val constraint }
  1075.     bMaxVal         : WordBool;         { Supports MAX Val constraint }
  1076.     bRefIntegrity   : WordBool;         { Can participate in ref integrity }
  1077.     bOtherChecks    : WordBool;         { Supports other kinds of checks }
  1078.     bKeyed          : WordBool;         { The field type can be keyed }
  1079.     bMultiplePerTable : WordBool;       { Table can have more than 1 of this type }
  1080.     iMinUnits1      : Word;             { Min units required (1) }
  1081.     iMinUnits2      : Word;             { Min units required (2) }
  1082.     bCreateable     : WordBool;         { Type can be created }
  1083.     szNativeName    : DBINAME;          { Native (SQL) name used in DDL }
  1084.     iUnUsed         : packed array [0..15] of Word;
  1085.   end;
  1086.  
  1087.   PROPValid = (                         { PROP Validity }
  1088.     epropINVALID,                       { Property is INVALID (not supported) }
  1089.     epropCANGET,                        { You can GET value of the property }
  1090.     epropCANSET                         { You can GET and SET value of the property }
  1091.   );
  1092.  
  1093. {============================================================================}
  1094. {                                Call Backs                                  }
  1095. {============================================================================}
  1096.  
  1097. type
  1098.   pCBType            = ^CBType;
  1099.   CBType = (                            { Call back type }
  1100.     cbGENERAL,                          { General purpose }
  1101.     cbRESERVED1,
  1102.     cbRESERVED2,
  1103.     cbINPUTREQ,                         { Input requested }
  1104.     cbRESERVED4,
  1105.     cbRESERVED5,
  1106.     cbBATCHRESULT,                      { Batch processing rslts }
  1107.     cbRESERVED7,
  1108.     cbRESTRUCTURE,                      { Restructure }
  1109.     cbRESERVED9,
  1110.     cbRESERVED10,
  1111.     cbRESERVED11,
  1112.     cbRESERVED12,
  1113.     cbRESERVED13,
  1114.     cbRESERVED14,
  1115.     cbRESERVED15,
  1116.     cbRESERVED16,
  1117.     cbRESERVED17,
  1118.     cbTABLECHANGED,                     { Table changed notification }
  1119.     cbRESERVED19,
  1120.     cbCANCELQRY,                        { Allow user to cancel Query }
  1121.     cbSERVERCALL,                       { Server Call }
  1122.     cbRESERVED22,
  1123.     cbGENPROGRESS,                      { Generic Progress report. }
  1124.     cbDBASELOGIN,                       { dBASE Login }
  1125.     cbDELAYEDUPD,                       { Delayed Updates }
  1126.     cbFIELDRECALC,                      { Field(s) recalculation }
  1127.     cbTRACE,                            { Trace }
  1128.     cbDBLOGIN,                          { Database login }
  1129.     cbDETACHNOTIFY,                     { DLL Detach Notification }
  1130.     cbNBROFCBS                          { Number of cbs }
  1131.   );
  1132.  
  1133. const
  1134.   cbYIELDCLIENT = cbCANCELQRY;
  1135.  
  1136. type
  1137.   pCBRType           = ^CBRType;
  1138.   CBRType = (                           { Call-back return type }
  1139.     cbrUSEDEF,                          { Take default action }
  1140.     cbrCONTINUE,                        { Continue }
  1141.     cbrABORT,                           { Abort the operation }
  1142.     cbrCHKINPUT,                        { Input given }
  1143.     cbrYES,                             { Take requested action }
  1144.     cbrNO,                              { Do not take requested action }
  1145.     cbrPARTIALASSIST,                   { Assist in completing the job }
  1146.     cbrSKIP,                            { Skip this operation }
  1147.     cbrRETRY                            { Retry this operation }
  1148.   );
  1149.  
  1150.   ppfDBICallBack = ^pfDBICallBack;
  1151.   pfDBICallBack  = function (           { Call-back funtion pntr type }
  1152.       ecbType       : CBType;           { Callback type }
  1153.       iClientData   : Longint;          { Client callback data }
  1154.       CbInfo        : Pointer           { Call back info/Client Input }
  1155.    ): CBRType stdcall;
  1156.  
  1157. { Progress callback structure }
  1158.  
  1159.   pCBPROGRESSDesc = ^CBPROGRESSDesc;
  1160.   CBPROGRESSDesc  = packed record
  1161.     iPercentDone    : SmallInt;         { Percentage done. }
  1162.     szMsg           : DBIMSG;           { Message to display }
  1163.   end;
  1164.  
  1165.   DelayUpdErrOpType = (                 { type of delayed update object (delayed updates callback) }
  1166.     delayupdNONE,
  1167.     delayupdMODIFY,
  1168.     delayupdINSERT,
  1169.     delayupdDELETE
  1170.   );
  1171.  
  1172.   PDELAYUPDCbDesc = ^DELAYUPDCbDesc;
  1173.   DELAYUPDCbDesc = packed record        { delayed updates callback info }
  1174.     iErrCode        : DBIResult;
  1175.     eDelayUpdOpType : DelayUpdErrOpType;
  1176.     iRecBufSize     : Word;             { Record size (physical record) }
  1177.     pNewRecBuf      : Pointer;
  1178.     pOldRecBuf      : Pointer;
  1179.   end;
  1180.  
  1181.   RESTErrObjType = (                    { type of restructure object (restructure callback) }
  1182.     restrNONE,
  1183.     restrNEWFLD,
  1184.     restrOLDFLD,
  1185.     restrNEWINDEX,
  1186.     restrOLDINDEX,
  1187.     restrNEWVCHK,
  1188.     restrOLDVCHK,
  1189.     restrNEWRINT,
  1190.     restrOLDRINT,
  1191.     restrNEWSEC,
  1192.     restrOLDSEC,
  1193.     restrNEWTABLE
  1194.   );
  1195.  
  1196.   pCBDBLogin = ^TCBDBLogin;
  1197.   TCBDBLogin = packed record            { Database login }
  1198.     szDbName        : DBINAME;          { Database name }
  1199.     eOpenMode       : DBIOpenMode;      { Open type desired }
  1200.     eShareMode      : DBIShareMode;     { Share type desired }
  1201.     szPassword      : DBINAME;          { Password }
  1202.     bCallbackToClose : Bool;            { Returned flag }
  1203.     hDb             : hDBIDb;           { db handle }
  1204.   end;
  1205.  
  1206. type
  1207.   pTRACECat = ^TRACECat;                { trace categories }
  1208.   TRACECat = TypedEnum;
  1209. const
  1210.     traceUNKNOWN   = $0000;
  1211.     traceQPREPARE  = $0001;             { prepared query statements }
  1212.     traceQEXECUTE  = $0002;             { executed query statements }
  1213.     traceERROR     = $0004;             { vendor errors }
  1214.     traceSTMT      = $0008;             { statement ops (i.e. allocate, free) }
  1215.     traceCONNECT   = $0010;             { connect / disconnect }
  1216.     traceTRANSACT  = $0020;             { transaction }
  1217.     traceBLOB      = $0040;             { blob i/o }
  1218.     traceMISC      = $0080;             { misc. }
  1219.     traceVENDOR    = $0100;             { vendor calls }
  1220.     traceDATAIN    = $0200;             { parameter bound data }
  1221.     traceDATAOUT   = $0400;             { trace fetched data }
  1222.  
  1223. type
  1224.   pTRACEDesc = ^TRACEDesc;
  1225.   TRACEDesc = packed record             { trace callback info }
  1226.     eTraceCat       : TRACECat;
  1227.     uTotalMsgLen    : Word;
  1228.     pszTrace        : array [0..0] of Char;
  1229.   end;
  1230.  
  1231. type
  1232.   TuObjDesc = packed record
  1233.     case Integer of
  1234.       1: (fldDesc:  FLDDesc);
  1235.       2: (idxDesc:  IDXDesc);
  1236.       3: (vchkDesc: VCHKDesc);
  1237.       4: (rintDesc: RINTDesc);
  1238.       5: (secDesc:  SECDesc);
  1239.   end;
  1240.  
  1241.   RESTCbDesc = packed record            { restructure callback info }
  1242.     iErrCode        : DBIResult;
  1243.     iTblNum         : Word;
  1244.     iObjNum         : Word;
  1245.     eRestrObjType   : RESTErrObjType;
  1246.     uObjDesc        : TuObjDesc;
  1247.   end;
  1248.  
  1249.   CBEntry = packed record
  1250.     szKeyWord       : DBINAME;          { Keyword to display }
  1251.     szHelp          : DBIMSG;           { Help String }
  1252.   end;
  1253.  
  1254. const
  1255.   MAXCBENTRIES       = 4;
  1256.  
  1257. type
  1258.   CBInputId = (
  1259.     cbiFILLER,                          { Force next to start at 1 }
  1260.     cbiMDXMISSING,                      { MDX file missing request }
  1261.     cbiPDXLOOKUP,                       { Lookup table missing }
  1262.     cbiPDXBLOB,                         { Blob file missing }
  1263.     cbiDBTMISSING,                      { DBT file missing request }
  1264.     cbiDRINPUT,                         { DR Manager needs user input }
  1265.     cbiRINTMISSING                      { RefInt link missing/corrupt }
  1266.   );
  1267.  
  1268.   PCBInputDesc = ^CBInputDesc;
  1269.   CBInputDesc = packed record
  1270.     eCbInputId      : CBInputId;        { Id for this input request }
  1271.     iCount          : SmallInt;         { Number of entries }
  1272.     iSelection      : SmallInt;         { Selection 1..n  (In/Out) }
  1273.     bSave           : WordBool;         { Save this option  (In/Out) }
  1274.     szMsg           : DBIMSG;           { Message to display }
  1275.     acbEntry        : packed array [0..MAXCBENTRIES-1] of CBEntry; { Entries }
  1276.   end;
  1277.  
  1278.   pCBLoginDesc = ^CBLoginDesc;
  1279.   CBLoginDesc  = packed record          { dBASE login callback structure }
  1280.     szUserName      : DBINAME;          { Login name of user }
  1281.     szGroupName     : DBINAME;          { Group to log in to }
  1282.     szUserPassword  : DBINAME;          { User password }
  1283.   end;
  1284.  
  1285. { cbSERVERCALL info }
  1286.  
  1287.   PCBSCType = ^CBSCType;
  1288.   CBSCType = (                             { Server call type }
  1289.     cbscRETURN,                            { Return from a call }
  1290.     cbscSQL                                { SQL server call }
  1291.   );
  1292.  
  1293. { cbYIELDCLIENT }
  1294.  
  1295.   PCBYieldStep = ^CBYieldStep;
  1296.   CBYieldStep = (
  1297.     cbYieldFirst,
  1298.     cbYieldContinue,
  1299.     cbYieldLast
  1300.   );
  1301.  
  1302. {============================================================================}
  1303. {                         Basic Query Types                                  }
  1304. {============================================================================}
  1305.  
  1306. type
  1307.   DBIQryLang = (
  1308.     qrylangUNKNOWN,                     { UNKNOWN (Error) }
  1309.     qrylangQBE,                         { QBE }
  1310.     qrylangSQL                          { SQL }
  1311.   );
  1312.  
  1313. {============================================================================}
  1314. {                         Statement parameter information                    }
  1315. {============================================================================}
  1316.  
  1317. type
  1318.   eINDValues = TypedEnum;
  1319. const
  1320.     indTRUNC     = -2;                   { Value has been truncated }
  1321.     indNULL      = -1;                   { Value is NULL }
  1322.     indVALUE     = 1;
  1323.  
  1324. const
  1325.   INDLEN             = sizeof(Word);
  1326.  
  1327. type
  1328.   STMTParamType = (
  1329.     paramUNKNOWN,                       { UNKNOWN (Error) }
  1330.     paramIN,                            { Input parameter }
  1331.     paramOUT,                           { Output parameter }
  1332.     paramINOUT,                         { Input/Output parameter }
  1333.     paramRET                            { Procedure (or function) return }
  1334.   );
  1335.  
  1336.   STMTParamFormat = (
  1337.     paramfmtUNKNOWN,                    { UNKNOWN (Error) }
  1338.     paramfmtNUMBER,                     { Numbered parameter markers of the form ? or :n }
  1339.     paramfmtNAME                        { Named parameters markers of the form :name }
  1340.   );
  1341.  
  1342. {============================================================================}
  1343. {                         Properties For DbiQPrepareExt                      }
  1344. {============================================================================}
  1345.  
  1346. const
  1347.   qprepNONE          = 0;               { like DbiQPrepare }
  1348.   qprepFORUPDATE     = $1;              { do extra work, anticipating UPDATE WHERE CURRENT }
  1349.  
  1350.  
  1351. {============================================================================}
  1352. {                      Date, Time, Number Formats                            }
  1353. {============================================================================}
  1354.  
  1355. type
  1356.   pFMTNumber = ^FMTNumber;
  1357.   FMTNumber = packed record             { Date Format }
  1358.     cDecimalSeparator : Char;           { Default "." }
  1359.     cThousandSeparator : Char;          { Default "," }
  1360.     iDecimalDigits  : Byte;             { Default 2 }
  1361.     bLeadingZero    : Boolean;          { Default TRUE. }
  1362.   end;
  1363.  
  1364.   pFMTDate = ^FMTDate;
  1365.   FMTDate = packed record
  1366.     szDateSeparator : packed array [0..3] of Char;    { Default "/" }
  1367.     iDateMode       : Byte;            { 0 = MDY (Def), 1 = DMY, 2 = YMD }
  1368.     bFourDigitYear  : Boolean;         { Write Year as 4 digits (FALSE) }
  1369.     bYearBiased     : Boolean;         { On input add 1900 to year (TRUE) }
  1370.     bMonthLeadingZero : Boolean;       { Month with Leading Zero (TRUE) }
  1371.     bDayLeadingZero : Boolean;         { Day with Leading Zero (TRUE) }
  1372.   end;
  1373.  
  1374.   pFMTTime = ^FMTTime;
  1375.   FMTTime = packed record
  1376.     cTimeSeparator  : Char;             { Default ":" }
  1377.     bTwelveHour     : Boolean;          { Represent as 12 Hour time (FALSE) }
  1378.     szAmString      : packed array [0..5] of Char;    { Default Null (Only for 12 Hr) }
  1379.     szPmString      : packed array [0..5] of Char;    { Default Null (Only for 12 Hr) }
  1380.     bSeconds        : Boolean;          { Show Seconds (TRUE) }
  1381.     bMilSeconds     : Boolean;          { Show Milli Seconds (FALSE) }
  1382.   end;
  1383.  
  1384.   pFMTBcd = ^FMTBcd;
  1385.   FMTBcd  = packed record
  1386.     iPrecision      : Byte;             { 1..64 considered valid }
  1387.     iSignSpecialPlaces : Byte;          { sign:1, special:1, places:6 }
  1388.     iFraction       : packed array [0..31] of Byte;    { bcd nibbles, 00..99 per byte, high nibble 1st }
  1389.   end;
  1390.  
  1391.  
  1392. {============================================================================}
  1393. {                              Error Info                                    }
  1394. {============================================================================}
  1395.  
  1396. type
  1397.   pDBIErrInfo        = ^DBIErrInfo;
  1398.   DBIErrInfo = packed record            { Error info }
  1399.     iError          : DBIResult;        { Last error code returned }
  1400.     szErrCode       : DBIMSG;           { Error Code }
  1401.     szContext       : packed array[1..4] of DBIMSG;    { Context info }
  1402.   end;
  1403.  
  1404. { Error contexts (To be used with DbiGetErrorContext) }
  1405.  
  1406. const
  1407.   ecTOKEN            = 1;               { Token (For QBE) }
  1408.   ecTABLENAME        = 3;               { Table name }
  1409.   ecFIELDNAME        = 4;               { Field Name }
  1410.   ecIMAGEROW         = 5;               { Image Row (For QBE) }
  1411.   ecUSERNAME         = 6;               { eg, In lock conflicts, user involved }
  1412.   ecFILENAME         = 7;               { File Name }
  1413.   ecINDEXNAME        = 8;               { Index Name }
  1414.   ecDIRNAME          = 9;               { Directory Name }
  1415.   ecKEYNAME          = 10;              { Key Name }
  1416.   ecALIAS            = 11;              { Alias }
  1417.   ecDRIVENAME        = 12;              { Drive name ('c:') }
  1418.   ecNATIVECODE       = 13;              { Native error code }
  1419.   ecNATIVEMSG        = 14;              { Native error message }
  1420.   ecLINENUMBER       = 15;              { Line Number }
  1421.   ecCAPABILITY       = 16;              { Capability }
  1422.   ecCDRNAME          = 17;              { Client Data Repository Name }
  1423.   ecUSERERRMSG       = 18;              { User Defined error msg }
  1424.   ecDROBJNAME        = 19;              { Data Repository Object Name }
  1425.   ecINTERNALLIMIT    = 20;              { Internal limit }
  1426.  
  1427. {============================================================================}
  1428. {                  Schema info structures                                    }
  1429. {============================================================================}
  1430. {                    Database descriptor                                     }
  1431. {============================================================================}
  1432.  
  1433.  
  1434. { DbiOpenDatabaseList }
  1435. type
  1436.   pDBDesc = ^DBDesc;
  1437.   DBDesc = packed record                { A given Database Description }
  1438.     szName          : DBINAME;          { Logical name (Or alias) }
  1439.     szText          : DBINAME;          { Descriptive text }
  1440.     szPhyName       : DBIPATH;          { Physical name/path }
  1441.     szDbType        : DBINAME;          { Database type }
  1442.   end;
  1443.  
  1444.  
  1445. {============================================================================}
  1446. {                    User info descriptor                                    }
  1447. {============================================================================}
  1448.  
  1449.  
  1450. { DbiOpenUserList }
  1451. type
  1452.   pUSERDesc = ^USERDesc;
  1453.   USERDesc = packed record              { User description }
  1454.     szUserName      : DBIUSERNAME;
  1455.     iNetSession     : Word;             { Net level session number }
  1456.     iProductClass   : Word;             { Product class of user }
  1457.     szSerialNum     : packed array [0..21] of Char; { Serial number }
  1458.   end;
  1459.  
  1460. {============================================================================}
  1461. {                    Table descriptor                                        }
  1462. {============================================================================}
  1463.  
  1464.  
  1465. { DbiOpenTableList }
  1466. type
  1467.   pTBLBaseDesc = ^TBLBaseDesc;
  1468.   TBLBaseDesc = packed record           { Table description (Base) }
  1469.     szName          : DBITBLNAME;       { Table name(No extension or Dir) }
  1470.     szFileName      : DBITBLNAME;       { File name }
  1471.     szExt           : DBIEXT;           { File extension }
  1472.     szType          : DBINAME;          { Driver type }
  1473.     dtDate          : DBIDATE;          { Date on the table }
  1474.     tmTime          : Time;             { Time on the table }
  1475.     iSize           : Longint;          { Size in bytes }
  1476.     bView           : WordBool;         { If this a view }
  1477.     bSynonym        : WordBool;         { If this is a synonym }
  1478.   end;
  1479.  
  1480.   pTBLExtDesc = ^TBLExtDesc;
  1481.   TBLExtDesc = packed record            { Table description (Extended part) }
  1482.     szStruct        : DBINAME;          { Physical structure }
  1483.     iRestrVersion   : Word;             { Version # }
  1484.     iRecSize        : Word;             { Physical record size }
  1485.     iFields         : Word;             { Number of fields }
  1486.     iIndexes        : Word;             { Number Indexes }
  1487.     iValChecks      : Word;             { Number of field validity checks }
  1488.     iRintChecks     : Word;             { Number of ref. integrity checks }
  1489.     iRecords        : Longint;          { Number of records in table }
  1490.     bProtected      : WordBool;         { If the table is prot }
  1491.     bValidInfo      : WordBool;         { Info available for this table }
  1492.   end;
  1493.  
  1494.   pTBLFullDesc = ^TBLFullDesc;
  1495.   TBLFullDesc = packed record           { Table description (Base + Ext) }
  1496.     tblBase         : TBLBaseDesc;      { Base      description }
  1497.     tblExt          : TBLExtDesc;       { Extended  description }
  1498.   end;
  1499.  
  1500. {============================================================================}
  1501. {                    File descriptor                                         }
  1502. {============================================================================}
  1503.  
  1504.  
  1505. { DbiOpenFileList }
  1506. type
  1507.   pFILEDesc = ^FILEDesc;
  1508.   FILEDesc = packed record              { File description }
  1509.     szFileName      : DBIPATH;          { File name (No Dir or ext) }
  1510.     szExt           : DBIEXT;           { Extension }
  1511.     bDir            : WordBool;         { True, if directory }
  1512.     iSize           : Longint;          { File size in bytes }
  1513.     dtDate          : DBIDATE;          { Date on the file }
  1514.     tmTime          : Time;             { Time on the file }
  1515.   end;
  1516.  
  1517. {======================================================================}
  1518. {            Stored Procedure and Stored Procedure Param descriptor    }
  1519. {======================================================================}
  1520.  
  1521. type
  1522.   pSPDesc = ^SPDesc;
  1523.   SPDesc = packed record
  1524.     szName          : DBISPNAME;
  1525.     dtDate          : DBIDATE;
  1526.     tmTime          : Time;
  1527.   end;
  1528.  
  1529.   pSPParamDesc = ^SPParamDesc;
  1530.   SPParamDesc = packed record
  1531.     uParamNum       : Word;
  1532.     szName          : DBINAME;
  1533.     eParamType      : STMTParamType;
  1534.     uFldType        : Word;
  1535.     uSubType        : Word;
  1536.     iUnits1         : SmallInt;
  1537.     iUnits2         : SmallInt;
  1538.     uOffset         : Word;
  1539.     uLen            : Word;
  1540.     uNullOffset     : Word;
  1541.   end;
  1542.  
  1543. {======================================================================}
  1544. {            Function and Function Argument Descriptors                }
  1545. {======================================================================}
  1546.  
  1547. type
  1548.   DBISTDFuncs = (
  1549.     fnAVG,
  1550.     fnCOUNT,
  1551.     fnMIN,
  1552.     fnMAX,
  1553.     fnSUM,
  1554.     fnSTDDEV,
  1555.     fnVARIANCE,
  1556.     fnABS,
  1557.     fnCEIL,
  1558.     fnCOS,
  1559.     fnCOSH,
  1560.     fnEXP,
  1561.     fnFLOOR,
  1562.     fnLN,
  1563.     fnLOG,
  1564.     fnMOD,
  1565.     fnPOWER,
  1566.     fnROUND,
  1567.     fnSIGN,
  1568.     fnSIN,
  1569.     fnSINH,
  1570.     fnSQRT,
  1571.     fnTAN,
  1572.     fnTANH,
  1573.     fnTRUNC,
  1574.     fnCHR,
  1575.     fnCONCAT,
  1576.     fnINITCAP,
  1577.     fnLOWER,
  1578.     fnLPAD,
  1579.     fnLTRIM,
  1580.     fnNLS_INITCAP,
  1581.     fnNLS_LOWER,
  1582.     fnNLS_UPPER,
  1583.     fnREPLACE,
  1584.     fnRPAD,
  1585.     fnRTRIM,
  1586.     fnSOUNDEX,
  1587.     fnSUBSTR,
  1588.     fnSUBSTRB,
  1589.     fnTRANSLATE,
  1590.     fnUPPER,
  1591.     fnASCII,
  1592.     fnINSTR,
  1593.     fnINSTRB,
  1594.     fnLENGTH,
  1595.     fnLENGTHB,
  1596.     fnNLSSORT,
  1597.     fnADD_MONTHS,
  1598.     fnLAST_DAY,
  1599.     fnMONTHS_BETWEEN,
  1600.     fnNEW_TIME,
  1601.     fnNEXT_DAY,
  1602.     fnSYSDATE,
  1603.     fnCONVERT,
  1604.     fnTO_CHAR,
  1605.     fnTO_DATE,
  1606.     fnTO_MULTI_BYTE,
  1607.     fnTO_NUMBER,
  1608.     fnTO_SINGLE_BYTE,
  1609.     fnUID,
  1610.     fnUSER,
  1611.     fnORACLEMISC,
  1612.     fnACOS,
  1613.     fnASIN,
  1614.     fnATAN,
  1615.     fnATN2,
  1616.     fnCOT,
  1617.     fnDEGREES,
  1618.     fnLOG10,
  1619.     fnPI,
  1620.     fnRADIANS,
  1621.     fnRAND,
  1622.     fnTEXTPTR,
  1623.     fnTEXTVALID,
  1624.     fnCHARINDEX,
  1625.     fnDIFFERENCE,
  1626.     fnPATINDEX,
  1627.     fnREPLICATE,
  1628.     fnREVERSE,
  1629.     fnRIGHT,
  1630.     fnSPACE,
  1631.     fnSTR,
  1632.     fnSTUFF,
  1633.     fnCOL_NAME,
  1634.     fnCOL_LENGTH,
  1635.     fnDATALENGTH,
  1636.     fnDB_ID,
  1637.     fnDB_NAME,
  1638.     fnHOST_ID,
  1639.     fnHOST_NAME,
  1640.     fnINDEX_COL,
  1641.     fnOBJECT_ID,
  1642.     fnOBJECT_NAME,
  1643.     fnUSER_ID,
  1644.     fnUSER_NAME,
  1645.     fnLEFT,
  1646.     fnLOCATE,
  1647.     fnTRUNCATE,
  1648.     fnCURTIME,
  1649.     fnDAYNAME,
  1650.     fnDAYOFMONTH,
  1651.     fnDAYOFWEEK,
  1652.     fnDAYOFYEAR,
  1653.     fnHOUR,
  1654.     fnMINUTE,
  1655.     fnMONTH,
  1656.     fnMONTHNAME,
  1657.     fnNOW,
  1658.     fnQUARTER,
  1659.     fnSECOND,
  1660.     fnWEEK,
  1661.     fnYEAR,
  1662.     fnDAY,
  1663.     fnWEEKDAY,
  1664.     fnTODAY,
  1665.     fnDATE,
  1666.     fnINFMISC
  1667.   );
  1668.  
  1669. type
  1670.   DBIFuncFlags = TypedEnum;
  1671.  
  1672. const
  1673.   fnSCALARS_ALLOW_CONSTANTS           = $0001;    { fn args may contain refeences to constants |
  1674.   fnSCALARS_ALLOW_COLUMNS             = $0002;    { fn args may contain refeences to columns }
  1675.   fnSCALARS_ALLOW_PARAMETERS          = $0004;    { fn args may contain refeences to parameters }
  1676.   fnSCALARS_ALLOW_FUNCTIONS           = $0008;    { fn args may contain refeences to functions }
  1677.   fnSCALARS_ALLOW_USER_DEFINED_FUNCS  = $0010;    { fn args may contain refeences to user defined functions }
  1678.   fnSCALARS_ALLOW_SUBQUERIES          = $0020;    { fn args can contain subqueries }
  1679.   fnSCALARS_ALLOW_CORRELATION         = $0040;    { fn subqueries can be correlated }
  1680.  
  1681. type
  1682.   DBIFUNCOpts = (
  1683.     fnDummy,
  1684.     fnListINCL_USER_DEF                 { include user-defined functions }
  1685.   );
  1686.  
  1687.   pDBIFUNCDesc = ^DBIFUNCDesc;
  1688.   DBIFUNCDesc  = packed record
  1689.     szName          : DBINAME;          { Function name }
  1690.     szDesc          : packed array [0..254] of Char; { Short description }
  1691.     uOverload       : Word;             { Number of function overloads }
  1692.     eStdFn          : DBISTDFuncs;      { Corresponds to DBI standard function }
  1693.   end;
  1694.  
  1695.  
  1696.   pDBIFUNCArgDesc = ^DBIFUNCArgDesc;
  1697.   DBIFUNCArgDesc  = packed record
  1698.     uArgNum         : Word;             { Argument position num; 0 for fn return }
  1699.     uFldType        : Word;             { Field type }
  1700.     uSubType        : Word;             { Field subtype (if applicable) }
  1701.     ufuncFlags      : Word;             { Function flags }
  1702.   end;
  1703.  
  1704. {============================================================================}
  1705. {                   Configuration Info Descriptor                            }
  1706. {============================================================================}
  1707.  
  1708.   CFGMode = (
  1709.     cfgPersistent,                      { Persistent only }
  1710.     cfgSession,                         { Session relative only }
  1711.     cfgAll                              { All (system and single session) }
  1712.   );
  1713.  
  1714. type
  1715.   CFGMode2 = type Integer;
  1716. const
  1717.     cfgmNone        = $00;
  1718.     cfgmVirtual     = $01;
  1719.     cfgmPersistent  = $02;
  1720.     cfgmSession     = $04;
  1721.     cfgmAll         = cfgmVirtual or cfgmPersistent or cfgmSession;
  1722.  
  1723. type
  1724.   CFGUpdate = (
  1725.     cfgUpdateOn,                        { Accept updates from other sessions }
  1726.     cfgUpdateOff                        { Do not updates from other sessions }
  1727.   );
  1728.  
  1729. { DbiOpenCfgInfoList }
  1730. type
  1731.   pCFGDesc = ^CFGDesc;
  1732.   CFGDesc = packed record               { Config description }
  1733.     szNodeName      : DBINAME;          { Node name }
  1734.     szDescription   : packed array [0..DBIMAXSCFLDLEN-1] of Char; { Node description }
  1735.     iDataType       : Word;             { Value type }
  1736.     szValue         : packed array [0..DBIMAXSCFLDLEN-1] of Char; { Value }
  1737.     bHasSubnodes    : WordBool;         { True, if not leaf node }
  1738.   end;
  1739.  
  1740.  
  1741. {============================================================================}
  1742. {                    Family descriptor                                       }
  1743. {============================================================================}
  1744.  
  1745.  
  1746. type
  1747.   pFMLType = ^FMLType;
  1748.   FMLType  = (                          { Family member types }
  1749.     fmlUNKNOWN,
  1750.     fmlTABLE,
  1751.     fmlINDEX,
  1752.     fmlFORM,
  1753.     fmlREPORT,
  1754.     fmlVALCHECK,
  1755.     fmlSECINDEX,
  1756.     fmlSECINDEX2,
  1757.     fmlBLOBFILE
  1758.   );
  1759.  
  1760. { DbiOpenFamilyList }
  1761. type
  1762.   pFMLDesc = ^FMLDesc;
  1763.   FMLDesc = packed record               { Family record structure }
  1764.     szName          : DBINAME;          { Member name (documentary) }
  1765.     iId             : Word;             { Id (if applicable) }
  1766.     eType           : FMLType;          { Member type }
  1767.     szFileName      : DBIPATH;          { File name of member }
  1768.   end;
  1769.  
  1770.  
  1771. {============================================================================}
  1772. {                    Language driver descriptor                              }
  1773. {============================================================================}
  1774.  
  1775.  
  1776. const
  1777.   DBIOEM_CP          = 1;               { (dos) }
  1778.   DBIANSI_CP         = 2;               { (win) }
  1779.   DBIOS2_CP          = 3;               { (OS2) }
  1780. (* UNIX etc. *)
  1781.   DBISUNOS_CP        = 4;
  1782.   DBIVMS_CP          = 5;
  1783.   DBIHPUX_CP         = 6;
  1784.   DBIULTRIX_CP       = 7;
  1785.   DBIAIX_CP          = 8;
  1786.   DBIAUX_CP          = 9;
  1787.   DBIXENIX_CP        = 10;
  1788.   DBIMAC_CP          = 11;
  1789.   DBINEXT_CP         = 12;
  1790.   DBIUNICODE_CP      = 13;
  1791.   DBIROMEN8_CP       = 14;
  1792.   DBIISO_CP          = 15;
  1793.  
  1794. { DbiOpenLdList }
  1795. type
  1796.   pLDDesc = ^LDDesc;
  1797.   LDDesc = packed record                { Lang Driver description }
  1798.     szName          : DBINAME;          { Driver symbolic name }
  1799.     szDesc          : DBINAME;          { Description }
  1800.     iCodePage       : Word;
  1801.     PrimaryCpPlatform : Word;
  1802.     AlternateCpPlatform : Word;
  1803.   end;
  1804.  
  1805. {============================================================================}
  1806. {                    Lock descriptor                                         }
  1807. {============================================================================}
  1808.  
  1809. { Lock types in LOCKDesc: }
  1810.  
  1811. const
  1812.   lckRECLOCK         = 0;               { Normal Record lock (Write) }
  1813.   lckRRECLOCK        = 1;               { Special Pdox Record lock (Read) }
  1814.   lckGROUPLOCK       = 2;               { Pdox Group lock }
  1815.   lckIMGAREA         = 3;               { Pdox Image area }
  1816.   lckTABLEREG        = 4;               { Table registration/Open (No lock) }
  1817.   lckTABLEREAD       = 5;               { Table Read lock }
  1818.   lckTABLEWRITE      = 6;               { Table Write lock }
  1819.   lckTABLEEXCL       = 7;               { Table Exclusive lock }
  1820.   lckUNKNOWN         = 9;               { Unknown lock }
  1821.  
  1822. { DbiOpenLockList }
  1823. type
  1824.   pLOCKDesc = ^LOCKDesc;
  1825.   LOCKDesc = packed record              { Lock Description }
  1826.     iType           : Word;             { Lock type (0 for rec lock) }
  1827.     szUserName      : DBIUSERNAME;      { Lock owner }
  1828.     iNetSession     : Word;             { Net level Session number }
  1829.     iSession        : Word;             { Idapi session#, if our lock }
  1830.     iRecNum         : Longint;          { If a record lock }
  1831.     iInfo           : Word;             { Info for table locks }
  1832.   end;
  1833.  
  1834. {============================================================================}
  1835. {                    Filter description                                      }
  1836. {============================================================================}
  1837.  
  1838. type
  1839.   pCANOp = ^CANOp;
  1840.   CANOp  = (
  1841.     canNOTDEFINED,                      {                                  (*) }
  1842.     canISBLANK,                         { CANUnary;  is operand blank.     (*) }
  1843.     canNOTBLANK,                        { CANUnary;  is operand not blank. (*) }
  1844.     canEQ,                              { CANBinary, CANCompare; equal.    (*) }
  1845.     canNE,                              { CANBinary; NOT equal.            (*) }
  1846.     canGT,                              { CANBinary; greater than.         (*) }
  1847.     canLT,                              { CANBinary; less than.            (*) }
  1848.     canGE,                              { CANBinary; greater or equal.     (*) }
  1849.     canLE,                              { CANBinary; less or equal.        (*) }
  1850.     canNOT,                             { CANUnary; NOT                    (*) }
  1851.     canAND,                             { CANBinary; AND                   (*) }
  1852.     canOR,                              { CANBinary; OR                    (*) }
  1853.     canTUPLE2,                          { CANUnary; Entire record is operand. }
  1854.     canFIELD2,                          { CANUnary; operand is field       (*) }
  1855.     canCONST2,                          { CANUnary; operand is constant    (*) }
  1856.     canMINUS,                           { CANUnary;  minus. }
  1857.     canADD,                             { CANBinary; addition. }
  1858.     canSUB,                             { CANBinary; subtraction. }
  1859.     canMUL,                             { CANBinary; multiplication. }
  1860.     canDIV,                             { CANBinary; division. }
  1861.     canMOD,                             { CANBinary; modulo division. }
  1862.     canREM,                             { CANBinary; remainder of division. }
  1863.     canSUM,                             { CANBinary, accumulate sum of. }
  1864.     canCOUNT,                           { CANBinary, accumulate count of. }
  1865.     canMIN,                             { CANBinary, find minimum of. }
  1866.     canMAX,                             { CANBinary, find maximum of. }
  1867.     canAVG,                             { CANBinary, find average of. }
  1868.     canCONT,                            { CANBinary; provides a link between two }
  1869.     canUDF2,                            { CANBinary; invokes a User defined fn }
  1870.     canCONTINUE2,                       { CANUnary; Stops evaluating records }
  1871.     canLIKE,                            { CANCompare, extended binary compare       (*) }
  1872.     canIN,                              { CANBinary field in list of values }
  1873.     canLIST2,                           { List of constant values of same type }
  1874.     canUPPER,                           { CANUnary: upper case }
  1875.     canLOWER,                           { CANUnary: lower case }
  1876.     canFUNC2,                           { CANFunc: Function }
  1877.     canLISTELEM2,                       { CANListElem: List Element }
  1878.     canASSIGN                           { CANBinary: Field assignment }
  1879.   );
  1880.  
  1881.   NODEClass = (                         { Node Class }
  1882.     nodeNULL,                           { Null node                  (*) }
  1883.     nodeUNARY,                          { Node is a unary            (*) }
  1884.     nodeBINARY,                         { Node is a binary           (*) }
  1885.     nodeCOMPARE,                        { Node is a compare          (*) }
  1886.     nodeFIELD,                          { Node is a field            (*) }
  1887.     nodeCONST,                          { Node is a constant         (*) }
  1888.     nodeTUPLE,                          { Node is a record }
  1889.     nodeCONTINUE,                       { Node is a continue node    (*) }
  1890.     nodeUDF,                            { Node is a UDF node }
  1891.     nodeLIST,                           { Node is a LIST node }
  1892.     nodeFUNC,                           { Node is a Function node }
  1893.     nodeLISTELEM                        { Node is a List Element node }
  1894.   );
  1895.  
  1896. { NODE definitions including misc data structures }
  1897. {-------------------------------------------------}
  1898.  
  1899. type
  1900.   pCANHdr = ^CANHdr;
  1901.   CANHdr = packed record                { Header part common to all     (*) }
  1902.     nodeClass       : NODEClass;
  1903.     canOp           : CANOp;
  1904.   end;
  1905.  
  1906.   pCANUnary = ^CANUnary;
  1907.   CANUnary = packed record              { Unary Node                    (*) }
  1908.     nodeClass       : NODEClass;
  1909.     canOp           : CANOp;
  1910.     iOperand1       : Word;             { Byte offset of Operand node }
  1911.   end;
  1912.  
  1913.   pCANBinary = ^CANBinary;
  1914.   CANBinary = packed record             { Binary Node                   (*) }
  1915.     nodeClass       : NODEClass;
  1916.     canOp           : CANOp;
  1917.     iOperand1       : Word;             { Byte offset of Op1 }
  1918.     iOperand2       : Word;             { Byte offset of Op2 }
  1919.   end;
  1920.  
  1921.   pCANField = ^CANField;
  1922.   CANField = packed record              { Field }
  1923.     nodeClass       : NODEClass;
  1924.     canOp           : CANOp;
  1925.     iFieldNum       : Word;
  1926.     iNameOffset     : Word;             { Name offset in Literal pool }
  1927.   end;
  1928.  
  1929.   pCANConst = ^CANConst;
  1930.   CANConst = packed record              { Constant }
  1931.     nodeClass       : NODEClass;
  1932.     canOp           : CANOp;
  1933.     iType           : Word;             { Constant type. }
  1934.     iSize           : Word;             { Constant size. (in bytes) }
  1935.     iOffset         : Word;             { Offset in the literal pool. }
  1936.   end;
  1937.  
  1938.   pCANTuple = ^CANTuple;
  1939.   CANTuple = packed record              { Tuple (record) }
  1940.     nodeClass       : NODEClass;
  1941.     canOp           : CANOp;
  1942.     iSize           : Word;             { Record size. (in bytes) }
  1943.   end;
  1944.  
  1945.   pCANContinue = ^CANContinue;
  1946.   CANContinue = packed record           { Break Node                    (*) }
  1947.     nodeClass       : NODEClass;
  1948.     canOp           : CANOp;
  1949.     iContOperand    : Word;             { Continue if operand is true. }
  1950.   end;
  1951.  
  1952.   pCANCompare = ^CANCompare;
  1953.   CANCompare = packed record            { Extended compare Node (text fields) (*) }
  1954.     nodeClass       : NODEClass;
  1955.     canOp           : CANOp;            { canLIKE, canEQ }
  1956.     bCaseInsensitive : WordBool;        { 3 val: UNKNOWN = "fastest", "native" }
  1957.     iPartialLen     : Word;             { Partial fieldlength (0 is full length) }
  1958.     iOperand1       : Word;             { Byte offset of Op1 }
  1959.     iOperand2       : Word;             { Byte offset of Op2 }
  1960.   end;
  1961.  
  1962.   pCANFunc = ^CANFunc;
  1963.   CANFunc = packed record               { Function }
  1964.     nodeClass       : NODEClass;
  1965.     canOp           : CANOp;
  1966.     iNameOffset     : Word;             { Name offset in Literal pool }
  1967.     iElemOffset     : Word;             { Offset of first List Element in Node pool }
  1968.   end;
  1969.  
  1970.   pCANListElem = ^CANListElem;
  1971.   CANListElem = packed record           { List Element }
  1972.     nodeClass       : NODEClass;
  1973.     canOp           : CANOp;
  1974.     iOffset         : Word;             { Arg offset in Node pool }
  1975.     iNextOffset     : Word;             { Offset in Node pool of next ListElem or 0 if end of list }
  1976.   end;
  1977.  
  1978. {This is the node to be used to pass User defined functions }
  1979. const
  1980.   iLangSQL           = 0;               { Common SQL dialect }
  1981.   iDbaseExpr         = 2;               { This is also the driver ID for dBASE }
  1982.  
  1983. type
  1984.   pCANUdf = ^CANUdf;
  1985.   CANUdf = packed record                { A user defined function }
  1986.     nodeClass       : NODEClass;
  1987.     canOp           : CANOp;
  1988.     iOffSzFuncName  : Word;             { Offset in literal pool to Function Name string(0 terminated) }
  1989.     iOperands       : Word;             { Byte offset of Operands (concatenated using canCONT) }
  1990.     iDrvDialect     : Word;             { Driver Dialect ID for UDF string supplied }
  1991.     iOffSzUDF       : Word;             { Offset in literal pool to UDF string (0 terminated) }
  1992.   end;
  1993.  
  1994.   pCANList = ^CANList;
  1995.   CANList = packed record           { List of Constants }
  1996.     nodeClass       : NODEClass; 
  1997.     canOp           : CANOp;
  1998.     iType           : Word;            { Constant type. }
  1999.     iTotalSize      : Word;            { Total list size; }
  2000.     iElemSize       : Word;            { Size of each elem for fix-width types }
  2001.     iElems          : Word;            { Number of elements in list }
  2002.     iOffset         : Word;            { Offset in the literal pool to first elem. }
  2003.   end;
  2004.  
  2005.   pCANNode = ^CANNode;
  2006.   CANNode = packed record
  2007.     case Integer of
  2008.       0: (canHdr      : CANHdr);
  2009.       1: (canUnary    : CANUnary);
  2010.       2: (canBinary   : CANBinary);
  2011.       3: (canField    : CANField);
  2012.       4: (canConst    : CANConst);
  2013.       5: (canTuple    : CANTuple);
  2014.       6: (canContinue : CANContinue);
  2015.       7: (canCompare  : CANCompare);
  2016.       8: (canList     : CANList);
  2017.       9: (canFunc     : CANFunc);
  2018.      10: (canListElem : CANListElem);
  2019.   end;
  2020.  
  2021. { Linear exression tree}
  2022. {----------------------}
  2023.  
  2024. const
  2025.   CANEXPRVERSION     = 2;
  2026.  
  2027. type
  2028.   ppCANExpr = ^pCANExpr;
  2029.   pCANExpr  = ^CANExpr;
  2030.   CANExpr   = packed record             { Expression Tree }
  2031.     iVer            : Word;             { Version tag of expression. }
  2032.     iTotalSize      : Word;             { Size of this structure }
  2033.     iNodes          : Word;             { Number of nodes }
  2034.     iNodeStart      : Word;             { Starting offet of Nodes in this }
  2035.     iLiteralStart   : Word;             { Starting offset of Literals in this }
  2036.   end;
  2037.  
  2038. {pfGENFilter returns TRUE, FALSE or ABORT }
  2039. const
  2040.   ABORT              = -2;
  2041.  
  2042. type
  2043.   pfGENFilter = function (
  2044.       ulClientData  : Longint;
  2045.       pRecBuf       : Pointer;
  2046.       iPhyRecNum    : Longint
  2047.    ): SmallInt stdcall;
  2048.  
  2049.   pFILTERInfo = ^FILTERInfo;
  2050.   FILTERInfo = packed record
  2051.     iFilterId       : Word;             { Id for filter }
  2052.     hFilter         : hDBIFilter;       { Filter handle }
  2053.     iClientData     : Longint;          { Client supplied data }
  2054.     iPriority       : Word;             { 1..N with 1 being highest }
  2055.     bCanAbort       : WordBool;         { TRUE : pfFilter can return ABORT }
  2056.     pfFilter        : pfGENFilter;      { Client filter function }
  2057.     pCanExpr        : Pointer;          { Supplied expression }
  2058.     bActive         : WordBool;         { TRUE : filter is active }
  2059.   end;
  2060.  
  2061. {----------------------------------------------------------------------------}
  2062. {   DBI Query related types                                                  }
  2063. {----------------------------------------------------------------------------}
  2064.  
  2065. const
  2066.   MAXQBEEXPRSIZE     = 300;             { size of one QBE expr }
  2067.  
  2068. type
  2069.   pDBIQryProp = ^DBIQryProp;
  2070.   DBIQryProp = packed record
  2071.     szQryName       : DBINAME;          { Name of query }
  2072.     eLang           : DBIQryLang;       { Language }
  2073.     iQryPrice       : SmallInt;         { Query price 1..100 (1 = cheap, 100 = expensive) }
  2074.     iNumTables      : SmallInt;         { Number of tables in join.  0 = unknown. }
  2075.     bHasAnswer      : WordBool;
  2076.     bInsert         : WordBool;
  2077.     bDelete         : WordBool;
  2078.     bChange         : WordBool;
  2079.   end;
  2080.  
  2081. const
  2082.   DBIQBE_ANSWERBIT   = ($1);            { Answer table bit flag }
  2083.   DBIQBE_INSERTEDBIT = ($2);            { Inserted table bit flag }
  2084.   DBIQBE_DELETEDBIT  = ($4);            { Deleted table bit flag }
  2085.   DBIQBE_CHANGEDBIT  = ($8);            { Changed table bit flag }
  2086.   DBIQBE_ERRORINSBIT = ($10);           { Error inserted table bit flag }
  2087.   DBIQBE_ERRORDELBIT = ($20);           { Error deleted table bit flag }
  2088.   DBIQBE_ERRORCHGBIT = ($40);           { Error changed table bit flag }
  2089.  
  2090.  
  2091. { answer cursor properties: }
  2092.  
  2093.   bAnsHasLiveFields  = $1;
  2094.   bAnsHasFilter      = $2;
  2095.   bAnsHasFieldMap    = $4;
  2096.   bAnsHasCalcField   = $8;
  2097.   bAnsHasLiveBlob    = $10;
  2098.  
  2099. { answer field properties: }
  2100.  
  2101.   bIsAnsFieldLive    = $1;
  2102.  
  2103. type
  2104.   DBIQryType = (
  2105.     dbiqryDEFAULT,
  2106.     dbiqryDIRTY,
  2107.     dbiqryCLEAN,
  2108.     dbiqryRESTART
  2109.   );
  2110.  
  2111.   pDBIQryProgress = ^DBIQryProgress;
  2112.   DBIQryProgress = packed record
  2113.     stepsInQry      : Word;             { Total steps in query. }
  2114.     stepsCompleted  : Word;             { Steps completed out of total (steps may be skipped). }
  2115.     totElemInStep   : Longint;          { Total elements in current step. }
  2116.     elemCompleted   : Longint;          { Elements completed in current step. }
  2117.   end;
  2118.  
  2119.   QryEvalMode = (
  2120.     qryModeNONE,                        { Reserved }
  2121.     qryModeLOCAL,
  2122.     qryModeSERVER,
  2123.     qryModeEITHER,
  2124.     qryModeNOWLOCAL                     { used only in call back, when failed on server }
  2125.   );
  2126.  
  2127. { values for client indicating live/canned preference about query execution }
  2128.  
  2129.   LIVENESS = (
  2130.     wantDEFAULT,                        { Default , same as wantCANNED }
  2131.     wantLIVE,                           { Want live data even if extra effort (no guarantee) }
  2132.     wantCANNED,                         { Want canned data even if extra effort (guaranteed) }
  2133.     wantSPEED                           { Let query manager decide, find out afterwards }
  2134.   );
  2135.  
  2136.   pQueryLowProps = ^QueryLowProps;
  2137.   QueryLowProps = packed record
  2138.     length          : SmallInt;         { Length in bytes of this structure }
  2139.     blankzeroes     : WordBool;         { TRUE if blanks to be regarded as zeros }
  2140.     dateFormat      : FMTDate;          { Date format }
  2141.     numberFormat    : FMTNumber;        { Number format }
  2142.     bNeedAuxTbls    : WordBool;         { If FALSE, don't bother with DELETED/ERRDEL, etc. }
  2143.     qryMode         : QryEvalMode;      { qryModeSERVER, qryModeLOCAL or qryModeEITHER. }
  2144.     perQrySqlMode   : WordBool;
  2145.     livenessDesired : LIVENESS;
  2146.   end;
  2147.  
  2148. {============================================================================}
  2149. {                      DBI symbols                                           }
  2150. {============================================================================}
  2151.  
  2152. const
  2153.   DBIMOD_BEGIN       = ($3F00);
  2154.  
  2155.   DBIMOD_QBE         = (DBIMOD_BEGIN + 1);
  2156.   DBIMOD_SQLG        = (DBIMOD_BEGIN + 2);
  2157.   DBIMOD_LEGO        = (DBIMOD_BEGIN + 3);
  2158.   DBIMOD_LOCKMNGR    = (DBIMOD_BEGIN + 4);
  2159.   DBIMOD_SQLDRIVER   = (DBIMOD_BEGIN + 5);
  2160.   DBIMOD_OS          = (DBIMOD_BEGIN + 6);
  2161.   DBIMOD_DBASEDRV    = (DBIMOD_BEGIN + 7);
  2162.   DBIMOD_CDR         = (DBIMOD_BEGIN + 8);
  2163.  
  2164.   DBIMOD_END         = (DBIMOD_BEGIN + 9);
  2165.  
  2166. {----------------------------------------------------------------------------}
  2167.  
  2168.   DBISYM_BEGIN       = (DBIMOD_END + 1);
  2169.  
  2170.   DBISYM_TOKEN       = (DBISYM_BEGIN + ecTOKEN);
  2171.   DBISYM_TABLENAME   = (DBISYM_BEGIN + ecTABLENAME);
  2172.   DBISYM_FIELDNAME   = (DBISYM_BEGIN + ecFIELDNAME);
  2173.   DBISYM_IMAGEROW    = (DBISYM_BEGIN + ecIMAGEROW);
  2174.   DBISYM_USERNAME    = (DBISYM_BEGIN + ecUSERNAME);
  2175.   DBISYM_FILENAME    = (DBISYM_BEGIN + ecFILENAME);
  2176.   DBISYM_INDEXNAME   = (DBISYM_BEGIN + ecINDEXNAME);
  2177.   DBISYM_DIRNAME     = (DBISYM_BEGIN + ecDIRNAME);
  2178.   DBISYM_KEYNAME     = (DBISYM_BEGIN + ecKEYNAME);
  2179.   DBISYM_ALIAS       = (DBISYM_BEGIN + ecALIAS);
  2180.   DBISYM_DRIVENAME   = (DBISYM_BEGIN + ecDRIVENAME);
  2181.   DBISYM_NATIVECODE  = (DBISYM_BEGIN + ecNATIVECODE);
  2182.   DBISYM_NATIVEMSG   = (DBISYM_BEGIN + ecNATIVEMSG);
  2183.   DBISYM_LINENUMBER  = (DBISYM_BEGIN + ecLINENUMBER);
  2184.   DBISYM_CAPABILITY  = (DBISYM_BEGIN + ecCAPABILITY);
  2185.   DBISYM_CDRNAME     = (DBISYM_BEGIN + ecCDRNAME);
  2186.   DBISYM_USERERRMSG  = (DBISYM_BEGIN + ecUSERERRMSG);
  2187.   DBISYM_DROBJNAME   = (DBISYM_BEGIN + ecDROBJNAME);
  2188.   DBISYM_INTERNALLIMIT = (DBISYM_BEGIN + ecINTERNALLIMIT);
  2189.  
  2190.   DBISYM_BASEEND     = (DBISYM_BEGIN + 100);
  2191.  
  2192. {----------------------------------------------------------------------------}
  2193.  
  2194.   DBISYM_MISC        = (DBISYM_BASEEND + 1);
  2195.  
  2196.   DBISYM_WORK        = (DBISYM_MISC + 1);
  2197.   DBISYM_PRIV        = (DBISYM_MISC + 2);
  2198.   DBISYM_COPY        = (DBISYM_MISC + 3);
  2199.   DBISYM_APPEND      = (DBISYM_MISC + 4);
  2200.   DBISYM_TXTPROBFLD1 = (DBISYM_MISC + 5);
  2201.   DBISYM_TXTPROBFLD2 = (DBISYM_MISC + 6);
  2202.   DBISYM_TXTPROBFLD3 = (DBISYM_MISC + 7);
  2203.  
  2204.  
  2205.   DBISYM_END         = (DBIMOD_BEGIN + $3FFF);
  2206.  
  2207. {============================================================================}
  2208. {                      DBI Config symbols                                    }
  2209. {============================================================================}
  2210.  
  2211. { Categories }
  2212.  
  2213.   szCFGSYSTEM        = 'SYSTEM';
  2214.   szCFGDRIVER        = 'DRIVERS';
  2215.   szCFGDATABASE      = 'DATABASES';
  2216.   szCFGREPOSITORY    = 'REPOSITORIES';
  2217.   szCFGPROVIDERS     = 'PROVIDERS';
  2218.  
  2219. {----------------------------------------------------------------------------}
  2220. { System Fields                                                              }
  2221. {----------------------------------------------------------------------------}
  2222.  
  2223.   szCFGSYSVERSION    = 'VERSION';
  2224.   szCFGSYSNETTYPE    = 'NET TYPE';
  2225.   szCFGSYSNETDIR     = 'NET DIR';
  2226.   szCFGSYSLOCALSHARE = 'LOCAL SHARE';
  2227.   szCFGSYSLANGDRV    = 'LANGDRIVER';
  2228.   szCFGSYSLANGDRVDIR = 'LANGDRVDIR';
  2229.   szCFGSYSMINBUF     = 'MINBUFSIZE';
  2230.   szCFGSYSMAXBUF     = 'MAXBUFSIZE';
  2231.   szCFGSYSLOCKRETRY  = 'LOCKRETRY';
  2232.   szCFGSYSFLAGS      = 'SYSFLAGS';
  2233.   szCFGMAXFILEHANDLES = 'MAXFILEHANDLES';
  2234.   szCFGSQLQRYMODE    = 'SQLQRYMODE';
  2235.   szCFGLOWMEMLIMIT   = 'LOW MEMORY USAGE LIMIT'; { Use this instead of NOLOWMEMBUF }
  2236.   szCFGSYSODBCCFGIMPORT = 'AUTO ODBC';
  2237.   szCFGAUTOODBC      = 'AUTO ODBC';
  2238.   szCFGDEFDRV        = 'DEFAULT DRIVER';
  2239.   szCFGSYSLOCALREPOSITORY = 'DATA REPOSITORY';
  2240. //szCFGSYSCOMMONREPOSITORY = 'COMMON REPOSITORY';
  2241.   szCFGSYSMEMSIZE                = 'MEMSIZE'; 
  2242.   szCFGSYSSHAREDMEMSIZE = 'SHAREDMEMSIZE';
  2243.   szCFGSYSSHAREDMEMLOCATION = 'SHAREDMEMLOCATION';
  2244.  
  2245. {----------------------------------------------------------------------------}
  2246. { Driver Fields                                                              }
  2247. {----------------------------------------------------------------------------}
  2248.  
  2249.   szCFGDRVVERSION    = 'VERSION';
  2250.   szCFGDRVTYPE       = 'TYPE';
  2251.   szCFGDRVDLL        = 'DLL';
  2252.   szCFGDRVDLL32      = 'DLL32';
  2253.   szCFGDRVFLAGS      = 'DRIVER FLAGS';
  2254.   szCFGDRVLANGDRIVER = 'LANGDRIVER';
  2255.   szCFGDRVFILLFACTOR = 'FILL FACTOR';
  2256.   szCFGDRVBLOCKSIZE  = 'BLOCK SIZE';
  2257.   szCFGDRVLOCKPROTOCOL = 'LOCKPROTOCOL';
  2258.   szCFGDRVLEVEL      = 'LEVEL';
  2259.   szCFGDRVVENDINIT   = 'VENDOR INIT';
  2260.   szCFGDRVTRACEMODE  = 'TRACE MODE';
  2261.  
  2262. {----------------------------------------------------------------------------}
  2263. { Dbase Driver fields                                                        }
  2264. {----------------------------------------------------------------------------}
  2265.  
  2266.   szCFGDRVMEMOBLOCKSIZE = 'MEMO FILE BLOCK SIZE';
  2267.   szCFGDRVMDXBLOCKSIZE = 'MDX BLOCK SIZE';
  2268.  
  2269.  
  2270. {----------------------------------------------------------------------------}
  2271. { Driver Nodes                                                               }
  2272. {----------------------------------------------------------------------------}
  2273.  
  2274.   szCFGDRVINIT       = 'INIT';
  2275.   szCFGDBCREATE      = 'DB CREATE';
  2276.   szCFGDBOPEN        = 'DB OPEN';
  2277.   szCFGTBLCREATE     = 'TABLE CREATE';
  2278.   szCFGTBLOPEN       = 'TABLE OPEN';
  2279.  
  2280. {----------------------------------------------------------------------------}
  2281. { Database Nodes                                                             }
  2282. {----------------------------------------------------------------------------}
  2283.  
  2284.   szCFGDBINFO        = 'DB INFO';
  2285.  
  2286. {----------------------------------------------------------------------------}
  2287. { Database fields                                                            }
  2288. {----------------------------------------------------------------------------}
  2289.  
  2290.   szCFGDBTYPE        = 'TYPE';
  2291.   szCFGDBPATH        = 'PATH';
  2292.   szCFGDBDEFAULTDRIVER = 'DEFAULT DRIVER';
  2293.   szCFGDBENABLEBCD   = 'ENABLE BCD';
  2294.  
  2295. {----------------------------------------------------------------------------}
  2296. { Others                                                                     }
  2297. {----------------------------------------------------------------------------}
  2298.  
  2299.   szCFGINIT          = 'INIT';
  2300.   szTYPE             = 'TYPE';
  2301.   szCFGDBSTANDARD    = 'STANDARD';
  2302.   szCFGTRUE          = 'TRUE';
  2303.   szCFGFALSE         = 'FALSE';
  2304.   szOPENMODE         = 'OPEN MODE';
  2305.   szREADWRITE        = 'READ/WRITE';
  2306.   szREADONLY         = 'READ ONLY';
  2307.   szSHAREMODE        = 'SHARE MODE';
  2308.   szEXCLUSIVE        = 'EXCLUSIVE';
  2309.   szSHARED           = 'SHARED';
  2310.   szUSERNAME         = 'USER NAME';
  2311.   szPASSWORD         = 'PASSWORD';
  2312.   szSERVERNAME       = 'SERVER NAME';
  2313.   szDATABASENAME     = 'DATABASE NAME';
  2314.   szSCHEMASIZE       = 'SCHEMA CACHE SIZE';
  2315.   szCFGSTRICTINTEGRITY = 'STRICTINTEGRTY';
  2316.   szSQLPASSMODE      = 'SQLPASSTHRU MODE';
  2317.   szNOTSHARED        = 'NOT SHARED';
  2318.   szSHAREDAUTOCOMMIT = 'SHARED AUTOCOMMIT';
  2319.   szSHAREDNOAUTOCOMMIT = 'SHARED NOAUTOCOMMIT';
  2320.   szSCHEMATIME       = 'SCHEMA CACHE TIME';
  2321.   szMAXQUERYTIME     = 'MAX QUERY TIME';
  2322.   szMAXROWS          = 'MAX ROWS';
  2323.   szLISTSYNONYMS     = 'LIST SYNONYMS';
  2324.   szSYNNONE          = 'NONE';
  2325.   szSYNALL           = 'ALL';
  2326.   szSYNPRIVATE       = 'PRIVATE';
  2327.   szBATCHCOUNT       = 'BATCH COUNT';
  2328.   szBLOBCOUNT        = 'BLOBS TO CACHE'; 
  2329.   szBLOBSIZE         = 'BLOB SIZE';
  2330.   szENABLESCHEMACACHE = 'ENABLE SCHEMA CACHE';
  2331.   szSCHEMACACHEDIR   = 'SCHEMA CACHE DIR';
  2332.   szSYBLHOST         = 'HOST NAME';
  2333.   szSYBLAPP          = 'APPLICATION NAME';
  2334.   szSYBLNATLANG      = 'NATIONAL LANG NAME';
  2335.   szTDSPACKETSIZE    = 'TDS PACKET SIZE';
  2336.   szORAINTEGER       = 'ENABLE INTEGERS';
  2337.   szDBNLS            = 'DBNLS';
  2338.   szCOLLCHAR         = 'COLLCHAR';
  2339.   szROWSETSIZE       = 'ROWSET SIZE';
  2340.   szCFG30            = '3';
  2341.   szCFGSERVER        = 'SERVER';
  2342.   szCFGIDODBC01      = 'IDODBC01.DLL';
  2343.   szCFGIDODBC32      = 'IDODBC32.DLL';
  2344.   szCFGODBCDRIVER    = 'ODBC DRIVER';
  2345.   szCFGNULL          = '';
  2346.   szCFGZERO          = '0';
  2347.   szCFG20            = '20';
  2348.   szCFG64            = '64';
  2349.   szCFG32            = '32';
  2350.   szCFGODBCDSN       = 'ODBC DSN';
  2351.   szCFGTWOHUNDRED    = '200';
  2352.   szCFGNEGONE        = '-1';
  2353.   szCFGEIGHT         = '8';
  2354.   szCLSID            = 'CLSID';
  2355.  
  2356. {----------------------------------------------------------------------------}
  2357. { Repository fields                                                          }
  2358. {----------------------------------------------------------------------------}
  2359.  
  2360.   szCFGDRDBNAME      = 'DATABASE NAME';
  2361.   szCFGDRTBLNAME     = 'TABLE NAME';
  2362.   szCFGDRLANGDRIVER  = 'LANGUAGE DRIVER';
  2363.   szCFGDRDESC        = 'DESCRIPTION';
  2364.  
  2365. {----------------------------------------------------------------------------}
  2366. { SYSTEM DATE/TIME/NUMBER FORMATS                                            }
  2367. { SYSTEM nodes:                                                              }
  2368. {----------------------------------------------------------------------------}
  2369.  
  2370.   szCFGFORMAT        = 'FORMATS';
  2371.  
  2372. {----------------------------------------------------------------------------}
  2373. { Format nodes:                                                              }
  2374. {----------------------------------------------------------------------------}
  2375.  
  2376.   szCFGDATE          = 'DATE';
  2377.   szCFGTIME          = 'TIME';
  2378.   szCFGNUMBER        = 'NUMBER';
  2379.  
  2380. {----------------------------------------------------------------------------}
  2381. { DATE and/or TIME fields:                                                   }
  2382. {----------------------------------------------------------------------------}
  2383.  
  2384.   szCFGSEPARATOR     = 'SEPARATOR';
  2385.   szCFGMODE          = 'MODE';
  2386.   szCFGFOURDIGITYEAR = 'FOURDIGITYEAR';
  2387.   szCFGYEARBIASED    = 'YEARBIASED';
  2388.   szCFGLEADINGZEROM  = 'LEADINGZEROM';
  2389.   szCFGLEADINGZEROD  = 'LEADINGZEROD';
  2390.   szCFGTWELVEHOUR    = 'TWELVEHOUR';
  2391.   szCFGAMSTRING      = 'AMSTRING';
  2392.   szCFGPMSTRING      = 'PMSTRING';
  2393.   szCFGSECONDS       = 'SECONDS';
  2394.   szCFGMILSECONDS    = 'MILSECONDS';
  2395.  
  2396. {----------------------------------------------------------------------------}
  2397. { Number fields:                                                             }
  2398. {----------------------------------------------------------------------------}
  2399.  
  2400.   szCFGDECIMALSEPARATOR = 'DECIMALSEPARATOR';
  2401.   szCFGTHOUSANDSEPARATOR = 'THOUSANDSEPARATOR';
  2402.   szCFGDECIMALDIGITS = 'DECIMALDIGITS';
  2403.   szCFGLEADINGZERON  = 'LEADINGZERON';
  2404.  
  2405. { String resoure id's for each string listed above }
  2406.  
  2407.   DBICFG_BASE        = $3A00;
  2408.  
  2409. {----------------------------------------------------------------------------}
  2410. { Categories                                                                 }
  2411. {----------------------------------------------------------------------------}
  2412.  
  2413.   iCFGSYSTEM         = (DBICFG_BASE + 1);
  2414.   iCFGDRIVER         = (DBICFG_BASE + 2);
  2415.   iCFGDATABASE       = (DBICFG_BASE + 3);
  2416.   iCFGREPOSITORY     = (DBICFG_BASE + 210);
  2417.  
  2418. {----------------------------------------------------------------------------}
  2419. { System Fields                                                              }
  2420. {----------------------------------------------------------------------------}
  2421.  
  2422.   iCFGSYSVERSION     = (DBICFG_BASE + 5);
  2423.   iCFGSYSNETTYPE     = (DBICFG_BASE + 6);
  2424.   iCFGSYSNETDIR      = (DBICFG_BASE + 7);
  2425.   iCFGSYSLOCALSHARE  = (DBICFG_BASE + 8);
  2426.   iCFGSYSLANGDRV     = (DBICFG_BASE + 9);
  2427.   iCFGSYSLANGDRVDIR  = (DBICFG_BASE + 10);
  2428.   iCFGSYSMINBUF      = (DBICFG_BASE + 11);
  2429.   iCFGSYSMAXBUF      = (DBICFG_BASE + 12);
  2430.   iCFGSYSLOCKRETRY   = (DBICFG_BASE + 13);
  2431.   iCFGSYSFLAGS       = (DBICFG_BASE + 14);
  2432.   iCFGMAXFILEHANDLES = (DBICFG_BASE + 15);
  2433.   iCFGSQLQRYMODE     = (DBICFG_BASE + 16);
  2434.   iCFGLOWMEMLIMIT    = (DBICFG_BASE + 17);
  2435.   iCFGSYSODBCCFGIMPORT = (DBICFG_BASE + 18);
  2436.   iCFGSYSLOCALREPOSITORY = (DBICFG_BASE + 211);
  2437. //iCFGSYSCOMMONREPOSITORY = (DBICFG_BASE + 212);
  2438.   iCFGSYSSHAREDMEMSIZE = (DBICFG_BASE + 250);
  2439.   iCFGSYSSHAREDMEMLOCATION = (DBICFG_BASE + 251);
  2440.   iCFGSYSMEMSIZE     = DBICFG_BASE + 125;
  2441.  
  2442.  
  2443. {----------------------------------------------------------------------------}
  2444. { Driver Fields                                                              }
  2445. {----------------------------------------------------------------------------}
  2446.  
  2447.   iCFGDRVVERSION     = (DBICFG_BASE + 20);
  2448.   iCFGDRVTYPE        = (DBICFG_BASE + 21);
  2449.   iCFGDRVLANGDRIVER  = (DBICFG_BASE + 22);
  2450.   iCFGDRVFILLFACTOR  = (DBICFG_BASE + 23);
  2451.   iCFGDRVBLOCKSIZE   = (DBICFG_BASE + 24);
  2452.   iCFGDRVLOCKPROTOCOL = (DBICFG_BASE + 25);
  2453.   iCFGDRVLEVEL       = (DBICFG_BASE + 26);
  2454.   iCFGDRVFLAGS       = (DBICFG_BASE + 27);
  2455.   iCFGDRVTRACEMODE   = (DBICFG_BASE + 28);
  2456.  
  2457. {----------------------------------------------------------------------------}
  2458. { Dbase Driver fields                                                        }
  2459. {----------------------------------------------------------------------------}
  2460.  
  2461.   iCFGDRVMEMOBLOCKSIZE = (DBICFG_BASE + 30 );
  2462.   iCFGDRVMDXBLOCKSIZE = (DBICFG_BASE + 31 );
  2463.  
  2464. {----------------------------------------------------------------------------}
  2465. { Driver Nodes                                                               }
  2466. {----------------------------------------------------------------------------}
  2467.  
  2468.   iCFGDRVINIT        = (DBICFG_BASE + 40 );
  2469.   iCFGDBCREATE       = (DBICFG_BASE + 41 );
  2470.   iCFGDBOPEN         = (DBICFG_BASE + 42 );
  2471.   iCFGTBLCREATE      = (DBICFG_BASE + 43 );
  2472.   iCFGTBLOPEN        = (DBICFG_BASE + 44 );
  2473.  
  2474. {----------------------------------------------------------------------------}
  2475. { Database Nodes                                                             }
  2476. {----------------------------------------------------------------------------}
  2477.  
  2478.   iCFGDBINFO         = (DBICFG_BASE + 50 );
  2479.  
  2480. {----------------------------------------------------------------------------}
  2481. { Database fields                                                            }
  2482. {----------------------------------------------------------------------------}
  2483.  
  2484.   iCFGDBTYPE         = (DBICFG_BASE + 60);
  2485.   iCFGDBPATH         = (DBICFG_BASE + 61);
  2486.   iCFGDBDEFAULTDRIVER = (DBICFG_BASE + 62);
  2487.   iCFGDBENABLEBCD    = (DBICFG_BASE + 63);
  2488.  
  2489. {----------------------------------------------------------------------------}
  2490. { Others                                                                     }
  2491. {----------------------------------------------------------------------------}
  2492.  
  2493.   iCFGINIT           = (DBICFG_BASE + 70);
  2494.   iTYPE              = (DBICFG_BASE + 71);
  2495.   iCFGDBSTANDARD     = (DBICFG_BASE + 72);
  2496.   iCFGTRUE           = (DBICFG_BASE + 73);
  2497.   iCFGFALSE          = (DBICFG_BASE + 74);
  2498.   iOPENMODE          = (DBICFG_BASE + 75);
  2499.   iREADWRITE         = (DBICFG_BASE + 76);
  2500.   iREADONLY          = (DBICFG_BASE + 77);
  2501.   iSHAREMODE         = (DBICFG_BASE + 78);
  2502.   iEXCLUSIVE         = (DBICFG_BASE + 79);
  2503.   iSHARED            = (DBICFG_BASE + 80);
  2504.   iUSERNAME          = (DBICFG_BASE + 81);
  2505.   iSERVERNAME        = (DBICFG_BASE + 82);
  2506.   iDATABASENAME      = (DBICFG_BASE + 83);
  2507.   iSCHEMASIZE        = (DBICFG_BASE + 84);
  2508.   iCFGSTRICTINTEGRITY = (DBICFG_BASE + 85);
  2509.   iTDSPACKETSIZE     = (DBICFG_BASE + 86);
  2510.   iORAINTEGER        = (DBICFG_BASE + 87);
  2511.   iDBNLS             = (DBICFG_BASE + 88);
  2512.   iCOLLCHAR          = (DBICFG_BASE + 89);
  2513. { numbers 90-? already used }
  2514.   iROWSETSIZE        = (DBICFG_BASE + 134);
  2515.  
  2516. {----------------------------------------------------------------------------}
  2517. { Repository Nodes                                                           }
  2518. {----------------------------------------------------------------------------}
  2519.  
  2520.   iCFGDRDBNAME       = (DBICFG_BASE + 213);
  2521.   iCFGDRTBLNAME      = (DBICFG_BASE + 214);
  2522.   iCFGDRDESC         = (DBICFG_BASE + 215);
  2523.   iCFGDRLANGDRIVER   = (DBICFG_BASE + 212);
  2524.  
  2525. {----------------------------------------------------------------------------}
  2526. { System node:                                                               }
  2527. {----------------------------------------------------------------------------}
  2528.  
  2529.   iCFGFORMAT         = (DBICFG_BASE + 130);
  2530.  
  2531. {----------------------------------------------------------------------------}
  2532. { Format nodes:                                                              }
  2533. {----------------------------------------------------------------------------}
  2534.  
  2535.   iCFGDATE           = (DBICFG_BASE + 131);
  2536.   iCFGTIME           = (DBICFG_BASE + 132);
  2537.   iCFGNUMBER         = (DBICFG_BASE + 133);
  2538.  
  2539. {----------------------------------------------------------------------------}
  2540. { DATE and/or TIME fields:                                                   }
  2541. {----------------------------------------------------------------------------}
  2542.  
  2543.   iCFGSEPARATOR      = (DBICFG_BASE + 140);
  2544.   iCFGMODE           = (DBICFG_BASE + 141);
  2545.   iCFGFOURDIGITYEAR  = (DBICFG_BASE + 142);
  2546.   iCFGYEARBIASED     = (DBICFG_BASE + 143);
  2547.   iCFGLEADINGZEROM   = (DBICFG_BASE + 144);
  2548.   iCFGLEADINGZEROD   = (DBICFG_BASE + 145);
  2549.   iCFGTWELVEHOUR     = (DBICFG_BASE + 146);
  2550.   iCFGAMSTRING       = (DBICFG_BASE + 147);
  2551.   iCFGPMSTRING       = (DBICFG_BASE + 148);
  2552.   iCFGSECONDS        = (DBICFG_BASE + 149);
  2553.   iCFGMILSECONDS     = (DBICFG_BASE + 150);
  2554.  
  2555. {----------------------------------------------------------------------------}
  2556. { Number fields:                                                             }
  2557. {----------------------------------------------------------------------------}
  2558.  
  2559.   iCFGDECIMALSEPARATOR  = (DBICFG_BASE + 160);
  2560.   iCFGTHOUSANDSEPARATOR = (DBICFG_BASE + 161);
  2561.   iCFGDECIMALDIGITS     = (DBICFG_BASE + 162);
  2562.   iCFGLEADINGZERON      = (DBICFG_BASE + 163);
  2563.  
  2564.   iCFGDEFLANGDRV        = (DBICFG_BASE + 165);
  2565.   iCFGDBASEDEFLANGDRV   = (DBICFG_BASE + 166);
  2566.  
  2567. {----------------------------------------------------------------------------}
  2568. { Formats                                                                    }
  2569. {----------------------------------------------------------------------------}
  2570.  
  2571.   iCFGDEFSEPARATOR          = (DBICFG_BASE + 170);
  2572.   iCFGDEFMODE               = (DBICFG_BASE + 171);
  2573.   iCFGDEFFOURDIGITYEAR      = (DBICFG_BASE + 172);
  2574.   iCFGDEFYEARBIASED         = (DBICFG_BASE + 173);
  2575.   iCFGDEFLEADINGZEROM       = (DBICFG_BASE + 174);
  2576.   iCFGDEFLEADINGZEROD       = (DBICFG_BASE + 175);
  2577.   iCFGDEFTWELVEHOUR         = (DBICFG_BASE + 176);
  2578.   iCFGDEFAMSTRING           = (DBICFG_BASE + 177);
  2579.   iCFGDEFPMSTRING           = (DBICFG_BASE + 178);
  2580.   iCFGDEFSECONDS            = (DBICFG_BASE + 179);
  2581.   iCFGDEFMILSECONDS         = (DBICFG_BASE + 180);
  2582.   iCFGDEFDECIMALSEPARATOR   = (DBICFG_BASE + 181);
  2583.   iCFGDEFTHOUSANDSEPARATOR  = (DBICFG_BASE + 182);
  2584.   iCFGDEFLEADINGZERO        = (DBICFG_BASE + 183);
  2585.  
  2586.   iCFGDEFVERSION            = (DBICFG_BASE + 184);
  2587.   iCFGDEFLOCALSHARE         = (DBICFG_BASE + 185);
  2588.   iCFGDEFMINBUFSIZE         = (DBICFG_BASE + 186);
  2589.   iCFGDEFMAXBUFSIZE         = (DBICFG_BASE + 187);
  2590.   iCFGDEFMAXFILEHANDLES     = (DBICFG_BASE + 188);
  2591.   iCFGDEFSYSFLAGS           = (DBICFG_BASE + 189);
  2592.   iCFGDEFLOWMEM             = (DBICFG_BASE + 190);
  2593.   iCFGDEFAUTOODBC           = (DBICFG_BASE + 191);
  2594.   iCFGDEFDEFDRV             = (DBICFG_BASE + 192);
  2595.  
  2596.   iCFGDEFDECIMALDIGITS      = (DBICFG_BASE + 193);
  2597.   iCFGDEFLEADINGZERON       = (DBICFG_BASE + 194);
  2598.  
  2599.   iCFGDEFPDXTYPE            = (DBICFG_BASE + 195);
  2600.   iCFGDEFPDXNETDIR          = (DBICFG_BASE + 196);
  2601.   iCFGDEFPDXLANGDRV         = (DBICFG_BASE + 197);
  2602.   iCFGDEFPDXLEVEL           = (DBICFG_BASE + 198);
  2603.   iCFGDEFPDXBLOCKSIZE       = (DBICFG_BASE + 199);
  2604.   iCFGDEFPDXFILLFACTOR      = (DBICFG_BASE + 200);
  2605.   iCFGDEFPDXSTRICTINTEGRTY  = (DBICFG_BASE + 201);
  2606.  
  2607.   iCFGDEFDBASETYPE          = (DBICFG_BASE + 202);
  2608.   iCFGDEFDBASELANGDRV       = (DBICFG_BASE + 203);
  2609.   iCFGDEFDBASELEVEL         = (DBICFG_BASE + 204);
  2610.   iCFGDEFDBASEMDXBLOCKSIZE  = (DBICFG_BASE + 205);
  2611.   iCFGDEFDBASEMEMOBLOCKSIZE = (DBICFG_BASE + 206);
  2612.  
  2613.   iCFGAUTOODBC              = (DBICFG_BASE + 207);
  2614.   iCFGDEFDRV                = (DBICFG_BASE + 208);
  2615.   iCFGENABLEBCD             = (DBICFG_BASE + 209);
  2616.   iCFGDEFSHAREDMEMSIZE      = (DBICFG_BASE + 252);
  2617.   iCFGDEFSHAREDMEMLOCATION  = (DBICFG_BASE + 253);
  2618.   iCFGDEFREPOSITORY         = (DBICFG_BASE + 254);
  2619.   iCFGDEFSQLQRYMODE         = (DBICFG_BASE + 255);
  2620.   iCFGDEFMEMSIZE            = (DBICFG_BASE + 126); 
  2621.  
  2622.  
  2623.   CFGHLP_BASE               = $3B00;
  2624.  
  2625.   iCFGHLP_SYSNODE           = (CFGHLP_BASE +1);
  2626.   iCFGHLP_SYSINITNODE       = (CFGHLP_BASE +2);
  2627.   iCFGHLP_SYSVERSION        = (CFGHLP_BASE +3);
  2628.   iCFGHLP_SYSLOCALSHARE     = (CFGHLP_BASE +4);
  2629.   iCFGHLP_SYSMINBUFSIZE     = (CFGHLP_BASE +5);
  2630.   iCFGHLP_SYSMAXBUFSIZE     = (CFGHLP_BASE +6);
  2631.   iCFGHLP_SYSLANGDRIVER     = (CFGHLP_BASE +7);
  2632.   iCFGHLP_SYSNETTYPE        = (CFGHLP_BASE +8);
  2633.   iCFGHLP_SYSFLAGS          = (CFGHLP_BASE +9);
  2634.   iCFGHLP_SYSMAXFILE        = (CFGHLP_BASE +10);
  2635.   iCFGHLP_SYSLOWMEM         = (CFGHLP_BASE +11);
  2636.   iCFGHLP_SYSAUTOODBC       = (CFGHLP_BASE +12);
  2637.   iCFGHLP_SYSDEFDRV         = (CFGHLP_BASE +13);
  2638.   iCFGHLP_SYSSQLQRYMODE     = (CFGHLP_BASE +14);
  2639.   iCFGHLP_SYSSQLPASSTHRU    = (CFGHLP_BASE +15);
  2640.   iCFGHLP_SYSFORMATNODE     = (CFGHLP_BASE +16);
  2641.   iCFGHLP_DATENODE          = (CFGHLP_BASE +17);
  2642.   iCFGHLP_DATESEPARATOR     = (CFGHLP_BASE +18);
  2643.   iCFGHLP_DATEMODE          = (CFGHLP_BASE +19);
  2644.   iCFGHLP_DATEFOURDIGIT     = (CFGHLP_BASE +20);
  2645.   iCFGHLP_DATEYEARBIASED    = (CFGHLP_BASE +21);
  2646.   iCFGHLP_DATEZEROM         = (CFGHLP_BASE +22);
  2647.   iCFGHLP_DATEZEROD         = (CFGHLP_BASE +23);
  2648.   iCFGHLP_TIMENODE          = (CFGHLP_BASE +24);
  2649.   iCFGHLP_TIMETWELVEHOUR    = (CFGHLP_BASE +25);
  2650.   iCFGHLP_TIMEAMSTRING      = (CFGHLP_BASE +26);
  2651.   iCFGHLP_TIMEPMSTRING      = (CFGHLP_BASE +27);
  2652.   iCFGHLP_TIMESECONDS       = (CFGHLP_BASE +28);
  2653.   iCFGHLP_TIMEMILSEC        = (CFGHLP_BASE +29);
  2654.   iCFGHLP_NUMNODE           = (CFGHLP_BASE +30);
  2655.   iCFGHLP_NUMDECIMALSEPARATOR = (CFGHLP_BASE +31);
  2656.   iCFGHLP_NUMTHOUSANDSEPARATOR = (CFGHLP_BASE +32);
  2657.   iCFGHLP_NUMDECIMALDIGITS  = (CFGHLP_BASE +33);
  2658.   iCFGHLP_NUMZERON          = (CFGHLP_BASE +34);
  2659.   iCFGHLP_DRVNODE           = (CFGHLP_BASE +35);
  2660.   iCFGHLP_PDXNODE           = (CFGHLP_BASE +36);
  2661.   iCFGHLP_PDXINITNODE       = (CFGHLP_BASE +37);
  2662.   iCFGHLP_DRVTYPE           = (CFGHLP_BASE +38);
  2663.   iCFGHLP_PDXNETDIR         = (CFGHLP_BASE +39);
  2664.   iCFGHLP_PDXTBLNODE        = (CFGHLP_BASE +40);
  2665.   iCFGHLP_PDXLEVEL          = (CFGHLP_BASE +41);
  2666.   iCFGHLP_PDXBLOCKSIZE      = (CFGHLP_BASE +42);
  2667.   iCFGHLP_PDXFILLFACTOR     = (CFGHLP_BASE +43);
  2668.   iCFGHLP_PDXSTRICT         = (CFGHLP_BASE +44);
  2669.   iCFGHLP_DBNODE            = (CFGHLP_BASE +45);
  2670.   iCFGHLP_DBINITNODE        = (CFGHLP_BASE +46);
  2671.   iCFGHLP_DBVERSION         = (CFGHLP_BASE +47);
  2672.   iCFGHLP_DBTBLNODE         = (CFGHLP_BASE +48);
  2673.   iCFGHLP_DBLEVEL           = (CFGHLP_BASE +49);
  2674.   iCFGHLP_DBMDXBLOCKSIZE    = (CFGHLP_BASE +50);
  2675.   iCFGHLP_DBMEMOFILEBLOCKSIZE = (CFGHLP_BASE +51);
  2676.   iCFGHLP_INTNODE           = (CFGHLP_BASE +52);
  2677.   iCFGHLP_INTINITNODE       = (CFGHLP_BASE +53);
  2678.   iCFGHLP_INTVERSION        = (CFGHLP_BASE +54);
  2679.   iCFGHLP_SQLDLL            = (CFGHLP_BASE +55);
  2680.   iCFGHLP_SQLDLL32          = (CFGHLP_BASE +56);
  2681.   iCFGHLP_SQLDRIVERFLAGS    = (CFGHLP_BASE +57);
  2682.   iCFGHLP_INTDBNODE         = (CFGHLP_BASE +58);
  2683.   iCFGHLP_SQLSERVER         = (CFGHLP_BASE +59);
  2684.   iCFGHLP_SQLUSER           = (CFGHLP_BASE +60);
  2685.   iCFGHLP_SQLOPENMODE       = (CFGHLP_BASE +61);
  2686.   iCFGHLP_SQLSCHEMASIZE     = (CFGHLP_BASE +62);
  2687.   iCFGHLP_SQLSCHEMATIME     = (CFGHLP_BASE +63);
  2688.   iCFGHLP_SYBNODE           = (CFGHLP_BASE +64);
  2689.   iCFGHLP_SYBINITNODE       = (CFGHLP_BASE +65);
  2690.   iCFGHLP_SYBVERSION        = (CFGHLP_BASE +66);
  2691.   iCFGHLP_SQLCONNECT        = (CFGHLP_BASE +67);
  2692.   iCFGHLP_SQLTIMEOUT        = (CFGHLP_BASE +68);
  2693.   iCFGHLP_SYBDBNODE         = (CFGHLP_BASE +69);
  2694.   iCFGHLP_SQLDATABASE       = (CFGHLP_BASE +70);
  2695.   iCFGHLP_SQLBLOBEDIT       = (CFGHLP_BASE +71);
  2696.   iCFGHLP_SQLMAXQUERY       = (CFGHLP_BASE +72);
  2697.   iCFGHLP_ORANODE           = (CFGHLP_BASE +73);
  2698.   iCFGHLP_ORAINITNODE       = (CFGHLP_BASE +74);
  2699.   iCFGHLP_ORAVERSION        = (CFGHLP_BASE +75);
  2700.   iCFGHLP_SQLVENDOR         = (CFGHLP_BASE +76);
  2701.   iCFGHLP_ORADBNODE         = (CFGHLP_BASE +77);
  2702.   iCFGHLP_SQLNETPROTOCOL    = (CFGHLP_BASE +78);
  2703.   iCFGHLP_MSSNODE           = (CFGHLP_BASE +79);
  2704.   iCFGHLP_MSSINITNODE       = (CFGHLP_BASE +80);
  2705.   iCFGHLP_MSSVERSION        = (CFGHLP_BASE +81);
  2706.   iCFGHLP_MSSDBNODE         = (CFGHLP_BASE +82);
  2707.   iCFGHLP_INFNODE           = (CFGHLP_BASE +83);
  2708.   iCFGHLP_INFINITNODE       = (CFGHLP_BASE +84);
  2709.   iCFGHLP_INFVERSION        = (CFGHLP_BASE +85);
  2710.   iCFGHLP_INFDBNODE         = (CFGHLP_BASE +86);
  2711.   iCFGHLP_SQLLOCKMODE       = (CFGHLP_BASE +87);
  2712.   iCFGHLP_SQLTRACEMODE      = (CFGHLP_BASE +88);
  2713.   iCFGHLP_SQLMAXROWS        = (CFGHLP_BASE +89);
  2714.   iCFGHLP_SQLBATCHCOUNT     = (CFGHLP_BASE +90);
  2715.   iCFGHLP_SYSSHAREDMEMSIZ   = (CFGHLP_BASE +91);
  2716.   iCFGHLP_SYSSHAREDMEMLOC   = (CFGHLP_BASE +92);
  2717.   iCFGHLP_SYSDATAREP        = (CFGHLP_BASE +93);
  2718.   iCFGHLP_ALIASTYPE         = (CFGHLP_BASE +94);
  2719.   iCFGHLP_ALIASPATH         = (CFGHLP_BASE +95);
  2720.   iCFGHLP_ALIASDEFDRV       = (CFGHLP_BASE +96);
  2721.   iCFGHLP_ENABLESCHEMACACHE = (CFGHLP_BASE +97);
  2722.   iCFGHLP_SCHEMACACHEDIR    = (CFGHLP_BASE +98);
  2723.   iCFGHLP_HOSTNAME          = (CFGHLP_BASE +99);
  2724.   iCFGHLP_APPLICATIONNAME   = (CFGHLP_BASE +100);
  2725.   iCFGHLP_NATIONALLANGNAME  = (CFGHLP_BASE +101);
  2726.   iCFGHLP_ALIASENABLEBCD    = (CFGHLP_BASE +102);
  2727.   iCFGHLP_TDSPACKETSIZE     = (CFGHLP_BASE +103);
  2728.   iCFGHLP_ORAINTEGER        = (CFGHLP_BASE +104);
  2729.   iCFGHLP_ORALISTSYNONYMS   = (CFGHLP_BASE +105);
  2730.   iCFGHLP_ROWSETSIZE        = (CFGHLP_BASE +106);
  2731.   iCFGHLP_DB2DRIVER         = (CFGHLP_BASE +107);
  2732.   iCFGHLP_DB2DSN            = (CFGHLP_BASE +108);
  2733.   iCFGHLP_DB2NODE           = (CFGHLP_BASE +109);
  2734.   iCFGHLP_DB2INITNODE       = (CFGHLP_BASE +110);
  2735.   iCFGHLP_DB2VERSION        = (CFGHLP_BASE +111);
  2736.   iCFGHLP_DB2DBNODE         = (CFGHLP_BASE +112);
  2737.   iCFGHLP_COLLCHAR          = (CFGHLP_BASE +113);
  2738.   iCFGHLP_DBNLS             = (CFGHLP_BASE +114);
  2739.   iCFGHLP_MSACCNODE         = (CFGHLP_BASE +115);
  2740.   iCFGHLP_MSACCINITNODE     = (CFGHLP_BASE +116);
  2741.   iCFGHLP_MSACCVERSION      = (CFGHLP_BASE +117);
  2742.   iCFGHLP_MSACCDBNODE       = (CFGHLP_BASE +118);
  2743.   iCFGHLP_ODBCDRIVER        = (CFGHLP_BASE +119);
  2744.   iCFGHLP_ODBCVERSION       = (CFGHLP_BASE +120);
  2745.   iCFGHLP_ODBCDSN           = (CFGHLP_BASE +121);
  2746.   iCFGHLP_OLEVERSION        = (CFGHLP_BASE +122);
  2747.   iCFGHLP_OLECLSID          = (CFGHLP_BASE +123);
  2748.   iCFGHLP_BLOBSTOCACHE      = (CFGHLP_BASE +124);
  2749.   iCFGHLP_BLOBSIZE          = (CFGHLP_BASE +125);
  2750.   iCFGHLP_SYSMEMSIZE        = (CFGHLP_BASE +126);
  2751.  
  2752. {============================================================================}
  2753. {                            Error Categories                                }
  2754. {============================================================================}
  2755.  
  2756. function ErrCat(rslt: Word): Word;
  2757. function ErrCode(rslt: Word): Word;
  2758.  
  2759. const
  2760.   ERRCAT_NONE                   = 0;      {  0   No error }
  2761.   ERRCAT_SYSTEM                 = $21;    {  33  System related (Fatal Error) }
  2762.   ERRCAT_NOTFOUND               = $22;    {  34  Object of interest Not Found }
  2763.   ERRCAT_DATACORRUPT            = $23;    {  35  Physical Data Corruption }
  2764.   ERRCAT_IO                     = $24;    {  36  I/O related error }
  2765.   ERRCAT_LIMIT                  = $25;    {  37  Resource or Limit error }
  2766.   ERRCAT_INTEGRITY              = $26;    {  38  Integrity Violation }
  2767.   ERRCAT_INVALIDREQ             = $27;    {  39  Invalid Request }
  2768.   ERRCAT_LOCKCONFLICT           = $28;    {  40  Locking/Contention related }
  2769.   ERRCAT_SECURITY               = $29;    {  41  Access Violation - Security related }
  2770.   ERRCAT_INVALIDCONTEXT         = $2A;    {  42  Invalid context }
  2771.   ERRCAT_OS                     = $2B;    {  43  Os Error not handled by Idapi }
  2772.   ERRCAT_NETWORK                = $2C;    {  44  Network related }
  2773.   ERRCAT_OPTPARAM               = $2D;    {  45  Optional parameter related }
  2774.   ERRCAT_QUERY                  = $2E;    {  46  Query related }
  2775.   ERRCAT_VERSION                = $2F;    {  47  Version Mismatch Category }
  2776.   ERRCAT_CAPABILITY             = $30;    {  48  Capability not supported }
  2777.   ERRCAT_CONFIG                 = $31;    {  49  System configuration error }
  2778.   ERRCAT_WARNING                = $32;    {  50 }
  2779.   ERRCAT_OTHER                  = $33;    {  51  Miscellaneous }
  2780.   ERRCAT_COMPATIBILITY          = $34;    {  52  Compatibility related }
  2781.   ERRCAT_REPOSITORY             = $35;    {  53  Data Repository related }
  2782.  
  2783.   ERRCAT_DRIVER                 = $3E;    {  62  Driver related }
  2784.   ERRCAT_RC                     = $3F;    {  63  Internal }
  2785.  
  2786.  
  2787.   ERRBASE_NONE                  = 0;      { No error }
  2788.   ERRBASE_SYSTEM                = $2100;  { System related (Fatal Error) }
  2789.   ERRBASE_NOTFOUND              = $2200;  { Object of interest Not Found }
  2790.   ERRBASE_DATACORRUPT           = $2300;  { Physical Data Corruption }
  2791.   ERRBASE_IO                    = $2400;  { I/O related error }
  2792.   ERRBASE_LIMIT                 = $2500;  { Resource or Limit error }
  2793.   ERRBASE_INTEGRITY             = $2600;  { Integrity Violation }
  2794.   ERRBASE_INVALIDREQ            = $2700;  { Invalid Request }
  2795.   ERRBASE_LOCKCONFLICT          = $2800;  { Locking/Contention related }
  2796.   ERRBASE_SEC                   = $2900;  { Access Violation - Security related }
  2797.   ERRBASE_IC                    = $2A00;  { Invalid context }
  2798.   ERRBASE_OS                    = $2B00;  { Os Error not handled by Idapi }
  2799.   ERRBASE_NETWORK               = $2C00;  { Network related }
  2800.   ERRBASE_OPTPARAM              = $2D00;  { Optional Parameter related }
  2801.   ERRBASE_QUERY                 = $2E00;  { Query related }
  2802.   ERRBASE_VERSION               = $2F00;  { Version Mismatch Category }
  2803.   ERRBASE_CAPABILITY            = $3000;  { Capability not supported }
  2804.   ERRBASE_CONFIG                = $3100;  { System configuration error }
  2805.   ERRBASE_WARNING               = $3200;
  2806.   ERRBASE_OTHER                 = $3300;  { Miscellaneous }
  2807.   ERRBASE_COMPATIBILITY         = $3400;  { Compatibility related }
  2808.   ERRBASE_REPOSITORY            = $3500;  { Data Repository related }
  2809.  
  2810.   ERRBASE_DRIVER                = $3E00;  { Driver related }
  2811.   ERRBASE_RC                    = $3F00;  { Internal }
  2812.  
  2813.  
  2814. {=============================================================================}
  2815. {                           Error Codes By Category                           }
  2816. {=============================================================================}
  2817.  
  2818. { ERRCAT_NONE                  (0) }
  2819. { ===========                      }
  2820.  
  2821.   ERRCODE_NONE                  = 0;
  2822.  
  2823.   DBIERR_NONE                   = (ERRBASE_NONE + ERRCODE_NONE);
  2824.  
  2825. {  ERRCAT_SYSTEM }
  2826. {  ============= }
  2827.  
  2828.   ERRCODE_SYSFILEOPEN           = 1;      { Cannot open a system file }
  2829.   ERRCODE_SYSFILEIO             = 2;      { I/O error on a system file }
  2830.   ERRCODE_SYSCORRUPT            = 3;      { Data structure corruption }
  2831.   ERRCODE_NOCONFIGFILE          = 4;      { Cannot find config file }
  2832.   ERRCODE_CFGCANNOTWRITE        = 5;      { Cannot write config file (READONLY) }
  2833.   ERRCODE_CFGMULTIFILE          = 6;      { Initializing with different ini file }
  2834.   ERRCODE_REENTERED             = 7;      { System has been illegally re-entered }
  2835.   ERRCODE_CANTFINDIDAPI         = 8;      { Cannot locate IDAPIxx.DLL }
  2836.   ERRCODE_CANTLOADIDAPI         = 9;      { Cannot load IDAPIxx.DLL }
  2837.   ERRCODE_CANTLOADLIBRARY       = 10;     { Cannot load a service DLL }
  2838.   ERRCODE_TEMPFILEERR           = 11;     { Cannot create or open temporary file }
  2839.   ERRCODE_MULTIPLEIDAPI         = 12;     { Trying to load multiple IDAPIxx.DLL }
  2840.  
  2841.   DBIERR_SYSFILEOPEN            = (ERRBASE_SYSTEM + ERRCODE_SYSFILEOPEN);
  2842.   DBIERR_SYSFILEIO              = (ERRBASE_SYSTEM + ERRCODE_SYSFILEIO);
  2843.   DBIERR_SYSCORRUPT             = (ERRBASE_SYSTEM + ERRCODE_SYSCORRUPT);
  2844.   DBIERR_NOCONFIGFILE           = (ERRBASE_SYSTEM + ERRCODE_NOCONFIGFILE);
  2845.   DBIERR_CFGCANNOTWRITE         = (ERRBASE_SYSTEM + ERRCODE_CFGCANNOTWRITE);
  2846.   DBIERR_CFGMULTIFILE           = (ERRBASE_SYSTEM + ERRCODE_CFGMULTIFILE);
  2847.   DBIERR_REENTERED              = (ERRBASE_SYSTEM + ERRCODE_REENTERED);
  2848.   DBIERR_CANTFINDIDAPI          = (ERRBASE_SYSTEM + ERRCODE_CANTFINDIDAPI);
  2849.   DBIERR_CANTLOADIDAPI          = (ERRBASE_SYSTEM + ERRCODE_CANTLOADIDAPI);
  2850.   DBIERR_CANTLOADLIBRARY        = (ERRBASE_SYSTEM + ERRCODE_CANTLOADLIBRARY);
  2851.   DBIERR_TEMPFILEERR            = (ERRBASE_SYSTEM + ERRCODE_TEMPFILEERR);
  2852.   DBIERR_MULTIPLEIDAPI          = (ERRBASE_SYSTEM + ERRCODE_MULTIPLEIDAPI);
  2853.  
  2854.   DBIERR_CANTFINDODAPI = DBIERR_CANTFINDIDAPI;
  2855.   DBIERR_CANTLOADODAPI = DBIERR_CANTLOADIDAPI;
  2856.  
  2857. {  ERRCAT_NOTFOUND }
  2858. {  =============== }
  2859.  
  2860.   ERRCODE_BOF                   = 1;      { Beginning of Virtual table }
  2861.   ERRCODE_EOF                   = 2;      { End of Virtual table }
  2862.   ERRCODE_RECMOVED              = 3;      { Fly-away }
  2863.   ERRCODE_KEYORRECDELETED       = 4;      { Record Deleted/Key Modified }
  2864.   ERRCODE_NOCURRREC             = 5;      { No current record }
  2865.   ERRCODE_RECNOTFOUND           = 6;      { Record was not found }
  2866.   ERRCODE_ENDOFBLOB             = 7;      { End of Blob reached }
  2867.   ERRCODE_OBJNOTFOUND           = 8;      { Generic Not found }
  2868.   ERRCODE_FMLMEMBERNOTFOUND     = 9;      { Family member not found }
  2869.   ERRCODE_BLOBFILEMISSING       = 10;     { 0x0a Blob file for table is missing }
  2870.   ERRCODE_LDNOTFOUND            = 11;     { 0x0b Language driver not found }
  2871.  
  2872.   DBIERR_BOF                    = (ERRBASE_NOTFOUND + ERRCODE_BOF);
  2873.   DBIERR_EOF                    = (ERRBASE_NOTFOUND + ERRCODE_EOF);
  2874.   DBIERR_RECMOVED               = (ERRBASE_NOTFOUND + ERRCODE_RECMOVED);
  2875.   DBIERR_RECDELETED             = (ERRBASE_NOTFOUND + ERRCODE_KEYORRECDELETED);
  2876.   DBIERR_KEYORRECDELETED        = (ERRBASE_NOTFOUND + ERRCODE_KEYORRECDELETED);
  2877.   DBIERR_NOCURRREC              = (ERRBASE_NOTFOUND + ERRCODE_NOCURRREC);
  2878.   DBIERR_RECNOTFOUND            = (ERRBASE_NOTFOUND + ERRCODE_RECNOTFOUND);
  2879.   DBIERR_ENDOFBLOB              = (ERRBASE_NOTFOUND + ERRCODE_ENDOFBLOB);
  2880.   DBIERR_OBJNOTFOUND            = (ERRBASE_NOTFOUND + ERRCODE_OBJNOTFOUND);
  2881.   DBIERR_FMLMEMBERNOTFOUND      = (ERRBASE_NOTFOUND + ERRCODE_FMLMEMBERNOTFOUND);
  2882.   DBIERR_BLOBFILEMISSING        = (ERRBASE_NOTFOUND + ERRCODE_BLOBFILEMISSING);
  2883.   DBIERR_LDNOTFOUND             = (ERRBASE_NOTFOUND + ERRCODE_LDNOTFOUND);
  2884.  
  2885. { ERRCAT_DATACORRUPT }
  2886. { ================== }
  2887.  
  2888.   ERRCODE_HEADERCORRUPT         = 1;      { Corrupt Header }
  2889.   ERRCODE_FILECORRUPT           = 2;      { File corrupt - other than header }
  2890.   ERRCODE_MEMOCORRUPT           = 3;      { Memo file corrupted }
  2891.   ERRCODE_BMPCORRUPT            = 4;      { BitMap is corrupt (Internal error) }
  2892.   ERRCODE_INDEXCORRUPT          = 5;      { Index is corrupt }
  2893.   ERRCODE_CORRUPTLOCKFILE       = 6;      { Corrupt lock file }
  2894.   ERRCODE_FAMFILEINVALID        = 7;      { Corrupt family file }
  2895.   ERRCODE_VALFILECORRUPT        = 8;      { Val file is missing or corrupt }
  2896.   ERRCODE_FOREIGNINDEX          = 9;      { Index is in a foreign format - import first }
  2897.  
  2898.  
  2899.   DBIERR_HEADERCORRUPT          = (ERRBASE_DATACORRUPT + ERRCODE_HEADERCORRUPT);
  2900.   DBIERR_FILECORRUPT            = (ERRBASE_DATACORRUPT + ERRCODE_FILECORRUPT);
  2901.   DBIERR_MEMOCORRUPT            = (ERRBASE_DATACORRUPT + ERRCODE_MEMOCORRUPT);
  2902.   DBIERR_BMPCORRUPT             = (ERRBASE_DATACORRUPT + ERRCODE_BMPCORRUPT);
  2903.   DBIERR_INDEXCORRUPT           = (ERRBASE_DATACORRUPT + ERRCODE_INDEXCORRUPT);
  2904.   DBIERR_CORRUPTLOCKFILE        = (ERRBASE_DATACORRUPT + ERRCODE_CORRUPTLOCKFILE);
  2905.   DBIERR_FAMFILEINVALID         = (ERRBASE_DATACORRUPT + ERRCODE_FAMFILEINVALID);
  2906.   DBIERR_VALFILECORRUPT         = (ERRBASE_DATACORRUPT + ERRCODE_VALFILECORRUPT);
  2907.   DBIERR_FOREIGNINDEX           = (ERRBASE_DATACORRUPT + ERRCODE_FOREIGNINDEX);
  2908.  
  2909.  
  2910. { ERRCAT_IO }
  2911. { ========= }
  2912.  
  2913.   ERRCODE_READERR               = 1;      { Read failure (not expected) }
  2914.   ERRCODE_WRITEERR              = 2;      { Write failure (not expected) }
  2915.   ERRCODE_DIRNOACCESS           = 3;      { No access to dir }
  2916.   ERRCODE_FILEDELETEFAIL        = 4;      { File delete failed }
  2917.   ERRCODE_FILENOACCESS          = 5;      { No access to file }
  2918.   ERRCODE_ACCESSDISABLED        = 6;      { Access to table disabled (previous error) }
  2919.  
  2920.   DBIERR_READERR                = (ERRBASE_IO + ERRCODE_READERR);
  2921.   DBIERR_WRITEERR               = (ERRBASE_IO + ERRCODE_WRITEERR);
  2922.   DBIERR_DIRNOACCESS            = (ERRBASE_IO + ERRCODE_DIRNOACCESS);
  2923.   DBIERR_FILEDELETEFAIL         = (ERRBASE_IO + ERRCODE_FILEDELETEFAIL);
  2924.   DBIERR_FILENOACCESS           = (ERRBASE_IO + ERRCODE_FILENOACCESS);
  2925.   DBIERR_ACCESSDISABLED         = (ERRBASE_IO + ERRCODE_ACCESSDISABLED);
  2926.  
  2927. { ERRCAT_LIMIT }
  2928. { ============ }
  2929.  
  2930.   ERRCODE_NOMEMORY              = 1;      { Not enough Memory for this op }
  2931.   ERRCODE_NOFILEHANDLES         = 2;      { Not enough File handles }
  2932.   ERRCODE_NODISKSPACE           = 3;      { Not enough Disk space }
  2933.   ERRCODE_NOTEMPTBLSPACE        = 4;      { Temporary Table resource limit }
  2934.   ERRCODE_RECTOOBIG             = 5;      { Too big a record size for table }
  2935.   ERRCODE_CURSORLIMIT           = 6;      { Too many open cursors }
  2936.   ERRCODE_TABLEFULL             = 7;      { Table is full }
  2937.   ERRCODE_WSSESLIMIT            = 8;      { Too many sessions from this WS }
  2938.   ERRCODE_SERNUMLIMIT           = 9;      { Serial number limit (paradox) }
  2939.   ERRCODE_INTERNALLIMIT         = 10;     { 0x0a Some internal limit (see context) }
  2940.   ERRCODE_OPENTBLLIMIT          = 11;     { 0x0b Too many open tables }
  2941.   ERRCODE_TBLCURSORLIMIT        = 12;     { 0x0c Too many cursors per table }
  2942.   ERRCODE_RECLOCKLIMIT          = 13;     { 0x0d Too many record locks on table }
  2943.   ERRCODE_CLIENTSLIMIT          = 14;     { 0x0e Too many clients }
  2944.   ERRCODE_INDEXLIMIT            = 15;     { 0x0f Too many indexes (also in Table Create) }
  2945.   ERRCODE_SESSIONSLIMIT         = 16;     { 0x10 Too many sessions }
  2946.   ERRCODE_DBLIMIT               = 17;     { 0x11 Too many databases }
  2947.   ERRCODE_PASSWORDLIMIT         = 18;     { 0x12 Too many passwords }
  2948.   ERRCODE_DRIVERLIMIT           = 19;     { 0x13 Too many active drivers }
  2949.   ERRCODE_FLDLIMIT              = 20;     { 0x14 Too many Fields in Table Create }
  2950.   ERRCODE_TBLLOCKLIMIT          = 21;     { 0x15 Too many table locks }
  2951.   ERRCODE_OPENBLOBLIMIT         = 22;     { 0x16 Too many open blobs }
  2952.   ERRCODE_LOCKFILELIMIT         = 23;     { 0x17 Lock file has grown too big }
  2953.   ERRCODE_OPENQRYLIMIT          = 24;     { 0x18 Too many open queries }
  2954.   ERRCODE_THREADLIMIT           = 25;     { 0x19 Too many threads for client }
  2955.   ERRCODE_BLOBLIMIT             = 26;     { 0x1a Too many blobs }
  2956.   ERRCODE_PDX50NAMELIMIT        = 27;     { 0x1b Pathname is too long for a Paradox 5.0 or less table }
  2957.   ERRCODE_ROWFETCHLIMIT         = 28;     { 0x1c Row fetch limit }
  2958.   ERRCODE_LONGNAMENOTALLOWED    = 29;     { 0x1d Long name is not allowed for this tableversion }
  2959.  
  2960.   DBIERR_NOMEMORY               = (ERRBASE_LIMIT + ERRCODE_NOMEMORY);
  2961.   DBIERR_NOFILEHANDLES          = (ERRBASE_LIMIT + ERRCODE_NOFILEHANDLES);
  2962.   DBIERR_NODISKSPACE            = (ERRBASE_LIMIT + ERRCODE_NODISKSPACE);
  2963.   DBIERR_NOTEMPTBLSPACE         = (ERRBASE_LIMIT + ERRCODE_NOTEMPTBLSPACE);
  2964.   DBIERR_RECTOOBIG              = (ERRBASE_LIMIT + ERRCODE_RECTOOBIG);
  2965.   DBIERR_CURSORLIMIT            = (ERRBASE_LIMIT + ERRCODE_CURSORLIMIT);
  2966.   DBIERR_TABLEFULL              = (ERRBASE_LIMIT + ERRCODE_TABLEFULL);
  2967.   DBIERR_WSSESLIMIT             = (ERRBASE_LIMIT + ERRCODE_WSSESLIMIT);
  2968.   DBIERR_SERNUMLIMIT            = (ERRBASE_LIMIT + ERRCODE_SERNUMLIMIT);
  2969.   DBIERR_INTERNALLIMIT          = (ERRBASE_LIMIT + ERRCODE_INTERNALLIMIT);
  2970.   DBIERR_OPENTBLLIMIT           = (ERRBASE_LIMIT + ERRCODE_OPENTBLLIMIT);
  2971.   DBIERR_TBLCURSORLIMIT         = (ERRBASE_LIMIT + ERRCODE_TBLCURSORLIMIT);
  2972.   DBIERR_RECLOCKLIMIT           = (ERRBASE_LIMIT + ERRCODE_RECLOCKLIMIT);
  2973.   DBIERR_CLIENTSLIMIT           = (ERRBASE_LIMIT + ERRCODE_CLIENTSLIMIT);
  2974.   DBIERR_INDEXLIMIT             = (ERRBASE_LIMIT + ERRCODE_INDEXLIMIT);
  2975.   DBIERR_SESSIONSLIMIT          = (ERRBASE_LIMIT + ERRCODE_SESSIONSLIMIT);
  2976.   DBIERR_DBLIMIT                = (ERRBASE_LIMIT + ERRCODE_DBLIMIT);
  2977.   DBIERR_PASSWORDLIMIT          = (ERRBASE_LIMIT + ERRCODE_PASSWORDLIMIT);
  2978.   DBIERR_DRIVERLIMIT            = (ERRBASE_LIMIT + ERRCODE_DRIVERLIMIT);
  2979.   DBIERR_FLDLIMIT               = (ERRBASE_LIMIT + ERRCODE_FLDLIMIT);
  2980.   DBIERR_TBLLOCKLIMIT           = (ERRBASE_LIMIT + ERRCODE_TBLLOCKLIMIT);
  2981.   DBIERR_OPENBLOBLIMIT          = (ERRBASE_LIMIT + ERRCODE_OPENBLOBLIMIT);
  2982.   DBIERR_LOCKFILELIMIT          = (ERRBASE_LIMIT + ERRCODE_LOCKFILELIMIT);
  2983.   DBIERR_OPENQRYLIMIT           = (ERRBASE_LIMIT + ERRCODE_OPENQRYLIMIT);
  2984.   DBIERR_THREADLIMIT            = (ERRBASE_LIMIT + ERRCODE_THREADLIMIT);
  2985.   DBIERR_BLOBLIMIT              = (ERRBASE_LIMIT + ERRCODE_BLOBLIMIT);
  2986.   DBIERR_PDX50NAMELIMIT         = (ERRBASE_LIMIT + ERRCODE_PDX50NAMELIMIT);
  2987.   DBIERR_ROWFETCHLIMIT          = (ERRBASE_LIMIT + ERRCODE_ROWFETCHLIMIT);
  2988.   DBIERR_LONGNAMENOTALLOWED     = (ERRBASE_LIMIT + ERRCODE_LONGNAMENOTALLOWED);
  2989.  
  2990.  
  2991. { ERRCAT_INTEGRITY }
  2992. { ================ }
  2993.  
  2994.   ERRCODE_KEYVIOL               = 1;      { Key violation }
  2995.   ERRCODE_MINVALERR             = 2;      { Min val check failed }
  2996.   ERRCODE_MAXVALERR             = 3;      { Max val check failed }
  2997.   ERRCODE_REQDERR               = 4;      { Field value required }
  2998.   ERRCODE_FORIEGNKEYERR         = 5;      { Master record missing }
  2999.   ERRCODE_DETAILRECORDSEXIST    = 6;      { Cannot MODIFY or DELETE this Master record }
  3000.   ERRCODE_MASTERTBLLEVEL        = 7;      { Master Table Level is incorrect }
  3001.   ERRCODE_LOOKUPTABLEERR        = 8;      { Field value out of lookup tbl range }
  3002.   ERRCODE_LOOKUPTBLOPENERR      = 9;      { Lookup Table Open failed }
  3003.   ERRCODE_DETAILTBLOPENERR      = 10;     { 0x0a Detail Table Open failed }
  3004.   ERRCODE_MASTERTBLOPENERR      = 11;     { 0x0b Master Table Open failed }
  3005.   ERRCODE_FIELDISBLANK          = 12;     { 0x0c Field is blank }
  3006.  
  3007.   ERRCODE_MASTEREXISTS          = 13;     { 0x0d Master Table exists }
  3008.   ERRCODE_MASTERTBLOPEN         = 14;     { 0x0e Master Table is open }
  3009.  
  3010.   ERRCODE_DETAILTABLESEXIST     = 15;     { 0x0f Detail Tables exist ( cannot delete, rename ... ) }
  3011.   ERRCODE_DETAILRECEXISTEMPTY   = 16;     { 0x10 Cannot empty because details exist }
  3012.   ERRCODE_MASTERREFERENCEERR    = 17;     { 0x11 Cannot modify while adding self referencing Referential Integrity }
  3013.   ERRCODE_DETAILTBLOPEN         = 18;     { 0x12 Detail Table is opened }
  3014.   ERRCODE_DEPENDENTSMUSTBEEMPTY = 19;     { 0x13 Cannot make a master a detail of another table if its details are not empty. }
  3015.   ERRCODE_RINTREQINDEX          = 20;     { 0x14 Ref. integrity fields must be indexed }
  3016.   ERRCODE_LINKEDTBLPROTECTED    = 21;     { 0x15 Master Table is protected ( requires password to open) }
  3017.   ERRCODE_FIELDMULTILINKED      = 22;     { 0x16 Field has more than one master }
  3018.   ERRCODE_EXPRVALERR            = 23;     { 0x17 Expr val check failed }
  3019.  
  3020.   DBIERR_KEYVIOL                = (ERRBASE_INTEGRITY + ERRCODE_KEYVIOL);
  3021.   DBIERR_MINVALERR              = (ERRBASE_INTEGRITY + ERRCODE_MINVALERR);
  3022.   DBIERR_MAXVALERR              = (ERRBASE_INTEGRITY + ERRCODE_MAXVALERR);
  3023.   DBIERR_REQDERR                = (ERRBASE_INTEGRITY + ERRCODE_REQDERR);
  3024.   DBIERR_FORIEGNKEYERR          = (ERRBASE_INTEGRITY + ERRCODE_FORIEGNKEYERR);
  3025.   DBIERR_DETAILRECORDSEXIST     = (ERRBASE_INTEGRITY + ERRCODE_DETAILRECORDSEXIST);
  3026.   DBIERR_MASTERTBLLEVEL         = (ERRBASE_INTEGRITY + ERRCODE_MASTERTBLLEVEL);
  3027.   DBIERR_LOOKUPTABLEERR         = (ERRBASE_INTEGRITY + ERRCODE_LOOKUPTABLEERR);
  3028.   DBIERR_LOOKUPTBLOPENERR       = (ERRBASE_INTEGRITY + ERRCODE_LOOKUPTBLOPENERR);
  3029.   DBIERR_DETAILTBLOPENERR       = (ERRBASE_INTEGRITY + ERRCODE_DETAILTBLOPENERR);
  3030.   DBIERR_MASTERTBLOPENERR       = (ERRBASE_INTEGRITY + ERRCODE_MASTERTBLOPENERR);
  3031.   DBIERR_FIELDISBLANK           = (ERRBASE_INTEGRITY + ERRCODE_FIELDISBLANK);
  3032.   DBIERR_MASTEREXISTS           = (ERRBASE_INTEGRITY + ERRCODE_MASTEREXISTS);
  3033.   DBIERR_MASTERTBLOPEN          = (ERRBASE_INTEGRITY + ERRCODE_MASTERTBLOPEN);
  3034.   DBIERR_DETAILTABLESEXIST      = (ERRBASE_INTEGRITY + ERRCODE_DETAILTABLESEXIST);
  3035.   DBIERR_DETAILRECEXISTEMPTY    = (ERRBASE_INTEGRITY + ERRCODE_DETAILRECEXISTEMPTY);
  3036.   DBIERR_MASTERREFERENCEERR     = (ERRBASE_INTEGRITY + ERRCODE_MASTERREFERENCEERR);
  3037.   DBIERR_DETAILTBLOPEN          = (ERRBASE_INTEGRITY + ERRCODE_DETAILTBLOPEN);
  3038.   DBIERR_DEPENDENTSMUSTBEEMPTY  = (ERRBASE_INTEGRITY + ERRCODE_DEPENDENTSMUSTBEEMPTY);
  3039.   DBIERR_RINTREQINDEX           = (ERRBASE_INTEGRITY + ERRCODE_RINTREQINDEX);
  3040.   DBIERR_LINKEDTBLPROTECTED     = (ERRBASE_INTEGRITY + ERRCODE_LINKEDTBLPROTECTED);
  3041.   DBIERR_FIELDMULTILINKED       = (ERRBASE_INTEGRITY + ERRCODE_FIELDMULTILINKED);
  3042.   DBIERR_EXPRVALERR             = (ERRBASE_INTEGRITY + ERRCODE_EXPRVALERR);
  3043.  
  3044.  
  3045. { ERRCAT_INVALIDREQ }
  3046. { ================= }
  3047.  
  3048.   ERRCODE_OUTOFRANGE            = 1;      { Number out of range (e.g field no) }
  3049.   ERRCODE_INVALIDPARAM          = 2;      { Generic invalid parameter }
  3050.   ERRCODE_INVALIDFILENAME       = 3;      { Invalid file name }
  3051.   ERRCODE_NOSUCHFILE            = 4;      { No such file }
  3052.   ERRCODE_INVALIDOPTION         = 5;      { Invalid option for a parameter }
  3053.   ERRCODE_INVALIDHNDL           = 6;      { Invalid handle to the function }
  3054.   ERRCODE_UNKNOWNTBLTYPE        = 7;      { Table type given not known }
  3055.   ERRCODE_UNKNOWNFILE           = 8;      { Dont know how to open file }
  3056.   ERRCODE_PRIMARYKEYREDEFINE    = 9;      { Cannot redefine primary key }
  3057.   ERRCODE_INVALIDRINTDESCNUM    = 10;     { 0x0a Cannot change this RINTDesc }
  3058.   ERRCODE_KEYFLDTYPEMISMATCH    = 11;     { 0x0b Foreign & Primary Key Mismatch }
  3059.   ERRCODE_INVALIDMODIFYREQUEST  = 12;     { 0x0c Invalid modify request }
  3060.   ERRCODE_NOSUCHINDEX           = 13;     { 0x0d Index does not exist }
  3061.   ERRCODE_INVALIDBLOBOFFSET     = 14;     { 0x0e Invalid Offset into the Blob }
  3062.   ERRCODE_INVALIDDESCNUM        = 15;     { 0x0f Invalid descriptor number }
  3063.   ERRCODE_INVALIDFLDTYPE        = 16;     { 0x10 Invalid field type }
  3064.   ERRCODE_INVALIDFLDDESC        = 17;     { 0x11 Invalid field descriptor }
  3065.   ERRCODE_INVALIDFLDXFORM       = 18;     { 0x12 Invalid field transform }
  3066.   ERRCODE_INVALIDRECSTRUCT      = 19;     { 0x13 Invalid record structure }
  3067.   ERRCODE_INVALIDDESC           = 20;     { 0x14 Generic: invalid descriptor }
  3068.   ERRCODE_INVALIDINDEXSTRUCT    = 21;     { 0x15 Invalid array of indexes descriptors }
  3069.   ERRCODE_INVALIDVCHKSTRUCT     = 22;     { 0x16 Invalid array of  val. check descriptors }
  3070.   ERRCODE_INVALIDRINTSTRUCT     = 23;     { 0x17 Invalid array of ref. integrity descriptors }
  3071.   ERRCODE_INVALIDRESTRTBLORDER  = 24;     { 0x18 Invalid ordering of tables during restructure }
  3072.   ERRCODE_NAMENOTUNIQUE         = 25;     { 0x19 Name not unique in this context }
  3073.   ERRCODE_INDEXNAMEREQUIRED     = 26;     { 0x1a Index name required }
  3074.   ERRCODE_INVALIDSESHANDLE      = 27;     { 0x1b Invalid ses handle }
  3075.   ERRCODE_INVALIDRESTROP        = 28;     { 0x1c Invalid restructure operation }
  3076.   ERRCODE_UNKNOWNDRIVER         = 29;     { 0x1d Driver not known to system }
  3077.   ERRCODE_UNKNOWNDB             = 30;     { 0x1e Unknown db }
  3078.   ERRCODE_INVALIDPASSWORD       = 31;     { 0x1f Invalid password given }
  3079.   ERRCODE_NOCALLBACK            = 32;     { 0x20 No callback function }
  3080.   ERRCODE_INVALIDCALLBACKBUFLEN = 33;     { 0x21 Invalid callback buffer length }
  3081.   ERRCODE_INVALIDDIR            = 34;     { 0x22 Invalid directory }
  3082.   ERRCODE_INVALIDXLATION        = 35;     { 0x23 Translate Error - Translate DID NOT happen }
  3083.   ERRCODE_DIFFERENTTABLES       = 36;     { 0x24 Cannot Set Cursor of one Table to another }
  3084.   ERRCODE_INVALIDBOOKMARK       = 37;     { 0x25 Bookmarks does not match table, etc. }
  3085.   ERRCODE_INVALIDINDEXNAME      = 38;     { 0x26 Index/Tag Name is invalid }
  3086.   ERRCODE_INVALIDIDXDESC        = 39;     { 0x27 Invalid index descriptor }
  3087.   ERRCODE_NOSUCHTABLE           = 40;     { 0x28 No such table }
  3088.   ERRCODE_USECOUNT              = 41;     { 0x29 Table has too many users }
  3089.   ERRCODE_INVALIDKEY            = 42;     { 0x2a Key does not pass filter condition }
  3090.   ERRCODE_INDEXEXISTS           = 43;     { 0x2b Index already exists }
  3091.   ERRCODE_INDEXOPEN             = 44;     { 0x2c Index is open }
  3092.   ERRCODE_INVALIDBLOBLEN        = 45;     { 0x2d Invalid Blob Length }
  3093.   ERRCODE_INVALIDBLOBHANDLE     = 46;     { 0x2e Invalid Blob handle (in record buffer) }
  3094.   ERRCODE_TABLEOPEN             = 47;     { 0x2f Table is open }
  3095.   ERRCODE_NEEDRESTRUCTURE       = 48;     { 0x30 Need to do (hard) restructure }
  3096.   ERRCODE_INVALIDMODE           = 49;     { 0x31 Invalid mode }
  3097.   ERRCODE_CANNOTCLOSE           = 50;     { 0x32 Cannot close index }
  3098.   ERRCODE_ACTIVEINDEX           = 51;     { 0x33 Index is being used to order tbl }
  3099.   ERRCODE_INVALIDUSRPASS        = 52;     { 0x34 Bad user name or password }
  3100.   ERRCODE_MULTILEVELCASCADE     = 53;     { 0x35 Multi level Cascade not supported }
  3101.   ERRCODE_INVALIDFIELDNAME      = 54;     { 0x36 Invalid field name }
  3102.   ERRCODE_INVALIDTABLENAME      = 55;     { 0x37 Invalid table name }
  3103.   ERRCODE_INVALIDLINKEXPR       = 56;     { 0x38 Invalid linked cursor expression }
  3104.   ERRCODE_NAMERESERVED          = 57;     { 0x39 Name is reserved }
  3105.   ERRCODE_INVALIDFILEEXTN       = 58;     { 0x3a Invalid file extention }
  3106.   ERRCODE_INVALIDLANGDRV        = 59;     { 0x3b Invalid language driver }
  3107.   ERRCODE_ALIASNOTOPEN          = 60;     { 0x3c Requested alias in not open }
  3108.   ERRCODE_INCOMPATRECSTRUCTS    = 61;     { 0x3d Incompatible record structures }
  3109.   ERRCODE_RESERVEDDOSNAME       = 62;     { 0x3e Reserved dos name }
  3110.   ERRCODE_DESTMUSTBEINDEXED     = 63;     { 0x3f Destination must be indexed }
  3111.   ERRCODE_INVALIDINDEXTYPE      = 64;     { 0x40 Invalid index type }
  3112.   ERRCODE_LANGDRVMISMATCH       = 65;     { 0x41 Language driver of table and index do not match }
  3113.   ERRCODE_NOSUCHFILTER          = 66;     { 0x42 Filter handle is invalid }
  3114.   ERRCODE_INVALIDFILTER         = 67;     { 0x43 Invalid filter }
  3115.  
  3116.   ERRCODE_INVALIDTABLECREATE    = 68;     { 0x44 Bad table create request (exact prob unknown) }
  3117.   ERRCODE_INVALIDTABLEDELETE    = 69;     { 0x45 Bad table delete request (exact prob unknown) }
  3118.   ERRCODE_INVALIDINDEXCREATE    = 70;     { 0x46 Bad index create request (exact prob unknown) }
  3119.   ERRCODE_INVALIDINDEXDELETE    = 71;     { 0x47 Bad index delete request (exact prob unknown) }
  3120.   ERRCODE_INVALIDTABLE          = 72;     { 0x48 Invalid table name specified }
  3121.   ERRCODE_MULTIRESULTS          = 73;     { 0X49 Multi results }
  3122.   ERRCODE_INVALIDTIME           = 74;     { 0X4A Multi results }
  3123.   ERRCODE_INVALIDDATE           = 75;     { 0X4B Multi results }
  3124.   ERRCODE_INVALIDTIMESTAMP      = 76;     { 0X4C Multi results }
  3125.   ERRCODE_DIFFERENTPATH         = 77;     { 0X4d Tables in different paths }
  3126.   ERRCODE_MISMATCHARGS          = 78;     { 0x4e MisMatch in the # of arguments }
  3127.   ERRCODE_FUNCTIONNOTFOUND      = 79;     { 0x4f Loaderlib cant find a func in the DLL (bad version?) }
  3128.   ERRCODE_MUSTUSEBASEORDER      = 80;     { 0x50 Must use baseorder for this operation }
  3129.   ERRCODE_INVALIDPROCEDURENAME  = 81;     { 0x51 Invalid procedure name }
  3130.   ERRCODE_INVALIDFLDMAP         = 82;     { 0x52 invalid field map }
  3131.  
  3132.  
  3133.   DBIERR_OUTOFRANGE             = (ERRBASE_INVALIDREQ + ERRCODE_OUTOFRANGE);
  3134.   DBIERR_INVALIDPARAM           = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDPARAM);
  3135.   DBIERR_INVALIDFILENAME        = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDFILENAME);
  3136.   DBIERR_NOSUCHFILE             = (ERRBASE_INVALIDREQ + ERRCODE_NOSUCHFILE);
  3137.   DBIERR_INVALIDOPTION          = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDOPTION);
  3138.   DBIERR_INVALIDHNDL            = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDHNDL);
  3139.   DBIERR_UNKNOWNTBLTYPE         = (ERRBASE_INVALIDREQ + ERRCODE_UNKNOWNTBLTYPE);
  3140.   DBIERR_UNKNOWNFILE            = (ERRBASE_INVALIDREQ + ERRCODE_UNKNOWNFILE);
  3141.   DBIERR_PRIMARYKEYREDEFINE     = (ERRBASE_INVALIDREQ + ERRCODE_PRIMARYKEYREDEFINE);
  3142.   DBIERR_INVALIDRINTDESCNUM     = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDRINTDESCNUM);
  3143.   DBIERR_KEYFLDTYPEMISMATCH     = (ERRBASE_INVALIDREQ + ERRCODE_KEYFLDTYPEMISMATCH);
  3144.   DBIERR_INVALIDMODIFYREQUEST   = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDMODIFYREQUEST);
  3145.   DBIERR_NOSUCHINDEX            = (ERRBASE_INVALIDREQ + ERRCODE_NOSUCHINDEX);
  3146.   DBIERR_INVALIDBLOBOFFSET      = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDBLOBOFFSET);
  3147.   DBIERR_INVALIDDESCNUM         = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDDESCNUM);
  3148.   DBIERR_INVALIDFLDTYPE         = (ERRBASE_INVALIDREQ +  ERRCODE_INVALIDFLDTYPE);
  3149.   DBIERR_INVALIDFLDDESC         = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDFLDDESC);
  3150.   DBIERR_INVALIDFLDXFORM        = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDFLDXFORM);
  3151.   DBIERR_INVALIDRECSTRUCT       = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDRECSTRUCT);
  3152.   DBIERR_INVALIDDESC            = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDDESC);
  3153.   DBIERR_INVALIDINDEXSTRUCT     = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDINDEXSTRUCT);
  3154.   DBIERR_INVALIDVCHKSTRUCT      = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDVCHKSTRUCT);
  3155.   DBIERR_INVALIDRINTSTRUCT      = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDRINTSTRUCT);
  3156.   DBIERR_INVALIDRESTRTBLORDER   = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDRESTRTBLORDER);
  3157.   DBIERR_NAMENOTUNIQUE          = (ERRBASE_INVALIDREQ + ERRCODE_NAMENOTUNIQUE);
  3158.   DBIERR_INDEXNAMEREQUIRED      = (ERRBASE_INVALIDREQ + ERRCODE_INDEXNAMEREQUIRED);
  3159.   DBIERR_INVALIDSESHANDLE       = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDSESHANDLE);
  3160.   DBIERR_INVALIDRESTROP         = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDRESTROP);
  3161.   DBIERR_UNKNOWNDRIVER          = (ERRBASE_INVALIDREQ + ERRCODE_UNKNOWNDRIVER);
  3162.   DBIERR_UNKNOWNDB              = (ERRBASE_INVALIDREQ + ERRCODE_UNKNOWNDB);
  3163.   DBIERR_INVALIDPASSWORD        = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDPASSWORD);
  3164.   DBIERR_NOCALLBACK             = (ERRBASE_INVALIDREQ + ERRCODE_NOCALLBACK);
  3165.   DBIERR_INVALIDCALLBACKBUFLEN  = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDCALLBACKBUFLEN );
  3166.   DBIERR_INVALIDDIR             = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDDIR);
  3167.   DBIERR_INVALIDXLATION         = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDXLATION);
  3168.   DBIERR_DIFFERENTTABLES        = (ERRBASE_INVALIDREQ + ERRCODE_DIFFERENTTABLES);
  3169.   DBIERR_INVALIDBOOKMARK        = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDBOOKMARK);
  3170.   DBIERR_INVALIDINDEXNAME       = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDINDEXNAME);
  3171.   DBIERR_INVALIDIDXDESC         = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDIDXDESC);
  3172.   DBIERR_NOSUCHTABLE            = (ERRBASE_INVALIDREQ + ERRCODE_NOSUCHTABLE);
  3173.   DBIERR_USECOUNT               = (ERRBASE_INVALIDREQ + ERRCODE_USECOUNT);
  3174.   DBIERR_INVALIDKEY             = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDKEY);
  3175.   DBIERR_INDEXEXISTS            = (ERRBASE_INVALIDREQ + ERRCODE_INDEXEXISTS);
  3176.   DBIERR_INDEXOPEN              = (ERRBASE_INVALIDREQ + ERRCODE_INDEXOPEN);
  3177.   DBIERR_INVALIDBLOBLEN         = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDBLOBLEN);
  3178.   DBIERR_INVALIDBLOBHANDLE      = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDBLOBHANDLE);
  3179.   DBIERR_TABLEOPEN              = (ERRBASE_INVALIDREQ + ERRCODE_TABLEOPEN);
  3180.   DBIERR_NEEDRESTRUCTURE        = (ERRBASE_INVALIDREQ + ERRCODE_NEEDRESTRUCTURE);
  3181.   DBIERR_INVALIDMODE            = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDMODE);
  3182.   DBIERR_CANNOTCLOSE            = (ERRBASE_INVALIDREQ + ERRCODE_CANNOTCLOSE);
  3183.   DBIERR_ACTIVEINDEX            = (ERRBASE_INVALIDREQ + ERRCODE_ACTIVEINDEX);
  3184.   DBIERR_INVALIDUSRPASS         = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDUSRPASS);
  3185.   DBIERR_MULTILEVELCASCADE      = (ERRBASE_INVALIDREQ + ERRCODE_MULTILEVELCASCADE);
  3186.   DBIERR_INVALIDFIELDNAME       = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDFIELDNAME);
  3187.   DBIERR_INVALIDTABLENAME       = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDTABLENAME);
  3188.   DBIERR_INVALIDLINKEXPR        = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDLINKEXPR);
  3189.   DBIERR_NAMERESERVED           = (ERRBASE_INVALIDREQ + ERRCODE_NAMERESERVED);
  3190.   DBIERR_INVALIDFILEEXTN        = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDFILEEXTN);
  3191.   DBIERR_INVALIDLANGDRV         = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDLANGDRV);
  3192.   DBIERR_ALIASNOTOPEN           = (ERRBASE_INVALIDREQ + ERRCODE_ALIASNOTOPEN);
  3193.   DBIERR_INCOMPATRECSTRUCTS     = (ERRBASE_INVALIDREQ + ERRCODE_INCOMPATRECSTRUCTS);
  3194.   DBIERR_RESERVEDOSNAME         = (ERRBASE_INVALIDREQ + ERRCODE_RESERVEDDOSNAME);
  3195.   DBIERR_DESTMUSTBEINDEXED      = (ERRBASE_INVALIDREQ + ERRCODE_DESTMUSTBEINDEXED);
  3196.   DBIERR_INVALIDINDEXTYPE       = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDINDEXTYPE);
  3197.   DBIERR_LANGDRVMISMATCH        = (ERRBASE_INVALIDREQ + ERRCODE_LANGDRVMISMATCH);
  3198.   DBIERR_NOSUCHFILTER           = (ERRBASE_INVALIDREQ + ERRCODE_NOSUCHFILTER);
  3199.   DBIERR_INVALIDFILTER          = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDFILTER);
  3200.   DBIERR_INVALIDTABLECREATE     = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDTABLECREATE);
  3201.   DBIERR_INVALIDTABLEDELETE     = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDTABLEDELETE);
  3202.   DBIERR_INVALIDINDEXCREATE     = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDINDEXCREATE);
  3203.   DBIERR_INVALIDINDEXDELETE     = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDINDEXDELETE);
  3204.   DBIERR_INVALIDTABLE           = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDTABLE);
  3205.   DBIERR_MULTIRESULTS           = (ERRBASE_INVALIDREQ + ERRCODE_MULTIRESULTS);
  3206.   DBIERR_INVALIDTIME            = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDTIME);
  3207.   DBIERR_INVALIDDATE            = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDDATE);
  3208.   DBIERR_INVALIDTIMESTAMP       = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDTIMESTAMP);
  3209.   DBIERR_DIFFERENTPATH          = (ERRBASE_INVALIDREQ + ERRCODE_DIFFERENTPATH);
  3210.   DBIERR_MISMATCHARGS           = (ERRBASE_INVALIDREQ + ERRCODE_MISMATCHARGS);
  3211.   DBIERR_FUNCTIONNOTFOUND       = (ERRBASE_INVALIDREQ + ERRCODE_FUNCTIONNOTFOUND);
  3212.   DBIERR_MUSTUSEBASEORDER       = (ERRBASE_INVALIDREQ + ERRCODE_MUSTUSEBASEORDER);
  3213.   DBIERR_INVALIDPROCEDURENAME   = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDPROCEDURENAME);
  3214.   DBIERR_INVALIDFLDMAP          = (ERRBASE_INVALIDREQ + ERRCODE_INVALIDFLDMAP);
  3215.  
  3216. { ERRCAT_LOCKCONFLICT }
  3217. { =================== }
  3218.  
  3219.   ERRCODE_LOCKED                = 1;
  3220.   ERRCODE_UNLOCKFAILED          = 2;
  3221.   ERRCODE_FILEBUSY              = 3;
  3222.   ERRCODE_DIRBUSY               = 4;
  3223.   ERRCODE_FILELOCKED            = 5;
  3224.   ERRCODE_DIRLOCKED             = 6;
  3225.   ERRCODE_ALREADYLOCKED         = 7;
  3226.   ERRCODE_NOTLOCKED             = 8;
  3227.   ERRCODE_LOCKTIMEOUT           = 9;
  3228.   ERRCODE_GROUPLOCKED           = 10;     { 0x0a }
  3229.   ERRCODE_LOSTTBLLOCK           = 11;     { 0x0b }
  3230.   ERRCODE_LOSTEXCLACCESS        = 12;     { 0x0c }
  3231.   ERRCODE_NEEDEXCLACCESS        = 13;     { 0x0d }
  3232.   ERRCODE_RECGROUPCONFLICT      = 14;     { 0x0e }
  3233.   ERRCODE_DEADLOCK              = 15;
  3234.   ERRCODE_ACTIVETRAN            = 16;
  3235.   ERRCODE_NOACTIVETRAN          = 17;
  3236.   ERRCODE_RECLOCKFAILED         = 18;
  3237.   ERRCODE_OPTRECLOCKFAILED      = 19;
  3238.   ERRCODE_OPTRECLOCKRECDEL      = 20;
  3239.   ERRCODE_LOCKEDRECS            = 21;
  3240.   ERRCODE_NEEDWRITELOCK         = 22;
  3241.  
  3242.   DBIERR_LOCKED                 = (ERRBASE_LOCKCONFLICT + ERRCODE_LOCKED);
  3243.   DBIERR_UNLOCKFAILED           = (ERRBASE_LOCKCONFLICT + ERRCODE_UNLOCKFAILED);
  3244.   DBIERR_FILEBUSY               = (ERRBASE_LOCKCONFLICT + ERRCODE_FILEBUSY);
  3245.   DBIERR_DIRBUSY                = (ERRBASE_LOCKCONFLICT + ERRCODE_DIRBUSY);
  3246.   DBIERR_FILELOCKED             = (ERRBASE_LOCKCONFLICT + ERRCODE_FILELOCKED);
  3247.   DBIERR_DIRLOCKED              = (ERRBASE_LOCKCONFLICT + ERRCODE_DIRLOCKED);
  3248.   DBIERR_ALREADYLOCKED          = (ERRBASE_LOCKCONFLICT + ERRCODE_ALREADYLOCKED);
  3249.   DBIERR_NOTLOCKED              = (ERRBASE_LOCKCONFLICT + ERRCODE_NOTLOCKED);
  3250.   DBIERR_LOCKTIMEOUT            = (ERRBASE_LOCKCONFLICT + ERRCODE_LOCKTIMEOUT);
  3251.   DBIERR_GROUPLOCKED            = (ERRBASE_LOCKCONFLICT + ERRCODE_GROUPLOCKED);
  3252.   DBIERR_LOSTTBLLOCK            = (ERRBASE_LOCKCONFLICT + ERRCODE_LOSTTBLLOCK);
  3253.   DBIERR_LOSTEXCLACCESS         = (ERRBASE_LOCKCONFLICT + ERRCODE_LOSTEXCLACCESS);
  3254.   DBIERR_NEEDEXCLACCESS         = (ERRBASE_LOCKCONFLICT  + ERRCODE_NEEDEXCLACCESS);
  3255.   DBIERR_RECGROUPCONFLICT       = (ERRBASE_LOCKCONFLICT + ERRCODE_RECGROUPCONFLICT);
  3256.   DBIERR_DEADLOCK               = (ERRBASE_LOCKCONFLICT + ERRCODE_DEADLOCK);
  3257.   DBIERR_ACTIVETRAN             = (ERRBASE_LOCKCONFLICT + ERRCODE_ACTIVETRAN);
  3258.   DBIERR_NOACTIVETRAN           = (ERRBASE_LOCKCONFLICT + ERRCODE_NOACTIVETRAN);
  3259.   DBIERR_RECLOCKFAILED          = (ERRBASE_LOCKCONFLICT + ERRCODE_RECLOCKFAILED);
  3260.   DBIERR_OPTRECLOCKFAILED       = (ERRBASE_LOCKCONFLICT + ERRCODE_OPTRECLOCKFAILED);
  3261.   DBIERR_OPTRECLOCKRECDEL       = (ERRBASE_LOCKCONFLICT + ERRCODE_OPTRECLOCKRECDEL);
  3262.  
  3263. { ERRCAT_SECURITY }
  3264. { =============== }
  3265.  
  3266.   ERRCODE_NOTSUFFFIELDRIGHTS    = 1;      { Not sufficient field  rights for operation }
  3267.   ERRCODE_NOTSUFFTABLERIGHTS    = 2;      { Not sufficient table  rights for operation }
  3268.   ERRCODE_NOTSUFFFAMILYRIGHTS   = 3;      { Not sufficient family rights for operation }
  3269.   ERRCODE_READONLYDIR           = 4;      { Is a read-only directory }
  3270.   ERRCODE_READONLYDB            = 5;      { Database is read-only }
  3271.   ERRCODE_READONLYFLD           = 6;      { Trying to modify read-only field }
  3272.   ERRCODE_TBLENCRYPTED          = 7;      { Table is encrypted (dBASE only) }
  3273.   ERRCODE_NOTSUFFSQLRIGHTS      = 8;      { Not sufficient sql rights for operation }
  3274.  
  3275.  
  3276.   DBIERR_NOTSUFFFIELDRIGHTS     = (ERRBASE_SEC + ERRCODE_NOTSUFFFIELDRIGHTS);
  3277.   DBIERR_NOTSUFFTABLERIGHTS     = (ERRBASE_SEC + ERRCODE_NOTSUFFTABLERIGHTS);
  3278.   DBIERR_NOTSUFFFAMILYRIGHTS    = (ERRBASE_SEC + ERRCODE_NOTSUFFFAMILYRIGHTS);
  3279.   DBIERR_READONLYDIR            = (ERRBASE_SEC + ERRCODE_READONLYDIR);
  3280.   DBIERR_READONLYDB             = (ERRBASE_SEC + ERRCODE_READONLYDB);
  3281.   DBIERR_READONLYFLD            = (ERRBASE_SEC + ERRCODE_READONLYFLD);
  3282.   DBIERR_TBLENCRYPTED           = (ERRBASE_SEC + ERRCODE_TBLENCRYPTED);
  3283.   DBIERR_NOTSUFFSQLRIGHTS       = (ERRBASE_SEC + ERRCODE_NOTSUFFSQLRIGHTS);
  3284.  
  3285.  
  3286. { ERRCAT_INVALIDCONTEXT }
  3287. { ===================== }
  3288.  
  3289.   ERRCODE_NOTABLOB              = 1;      { Field is not a blob }
  3290.   ERRCODE_BLOBOPENED            = 2;      { Blob already opened }
  3291.   ERRCODE_BLOBNOTOPENED         = 3;      { Blob not opened }
  3292.   ERRCODE_NA                    = 4;      { Operation not applicable }
  3293.   ERRCODE_NOTINDEXED            = 5;      { Table is not indexed }
  3294.   ERRCODE_NOTINITIALIZED        = 6;      { Engine not initialized }
  3295.   ERRCODE_MULTIPLEINIT          = 7;      { Attempt to re-initialize engine }
  3296.   ERRCODE_NOTSAMESESSION        = 8;      { Attempt to mix objs from diff ses }
  3297.   ERRCODE_PDXDRIVERNOTACTIVE    = 9;      { Paradox driver not active }
  3298.   ERRCODE_DRIVERNOTLOADED       = 10;     { 0x0a Driver not loaded }
  3299.   ERRCODE_TABLEREADONLY         = 11;     { 0x0b Table is read only }
  3300.   ERRCODE_NOASSOCINDEX          = 12;     { 0x0c No index associated with the cursor }
  3301.   ERRCODE_HASOPENCURSORS        = 13;     { 0x0d Has open cursors }
  3302.   ERRCODE_NOTABLESUPPORT        = 14;     { 0x0e Op cannot be done on this table }
  3303.   ERRCODE_INDEXREADONLY         = 15;     { 0x0f Index is read only }
  3304.   ERRCODE_NOUNIQUERECS          = 16;     { 0x10 Records are not unique }
  3305.   ERRCODE_NOTCURSESSION         = 17;     { 0x11 Not the current/active session }
  3306.   ERRCODE_INVALIDKEYWORD        = 18;     { 0x12 Invalid use of keyword. }
  3307.   ERRCODE_CONNECTINUSE          = 19;     { 0x13 Connection in use }
  3308.   ERRCODE_CONNECTNOTSHARED      = 20;     { 0x14 Passthru SQL connection not share }
  3309.  
  3310.  
  3311.   DBIERR_NOTABLOB               = (ERRBASE_IC + ERRCODE_NOTABLOB);
  3312.   DBIERR_BLOBOPENED             = (ERRBASE_IC + ERRCODE_BLOBOPENED);
  3313.   DBIERR_BLOBNOTOPENED          = (ERRBASE_IC + ERRCODE_BLOBNOTOPENED);
  3314.   DBIERR_NA                     = (ERRBASE_IC + ERRCODE_NA);
  3315.   DBIERR_NOTINDEXED             = (ERRBASE_IC + ERRCODE_NOTINDEXED);
  3316.   DBIERR_NOTINITIALIZED         = (ERRBASE_IC + ERRCODE_NOTINITIALIZED);
  3317.   DBIERR_MULTIPLEINIT           = (ERRBASE_IC + ERRCODE_MULTIPLEINIT);
  3318.   DBIERR_NOTSAMESESSION         = (ERRBASE_IC + ERRCODE_NOTSAMESESSION);
  3319.   DBIERR_PDXDRIVERNOTACTIVE     = (ERRBASE_IC + ERRCODE_PDXDRIVERNOTACTIVE);
  3320.   DBIERR_DRIVERNOTLOADED        = (ERRBASE_IC + ERRCODE_DRIVERNOTLOADED);
  3321.   DBIERR_TABLEREADONLY          = (ERRBASE_IC + ERRCODE_TABLEREADONLY);
  3322.   DBIERR_NOASSOCINDEX           = (ERRBASE_IC + ERRCODE_NOASSOCINDEX);
  3323.   DBIERR_HASOPENCURSORS         = (ERRBASE_IC + ERRCODE_HASOPENCURSORS);
  3324.   DBIERR_NOTABLESUPPORT         = (ERRBASE_IC + ERRCODE_NOTABLESUPPORT);
  3325.   DBIERR_INDEXREADONLY          = (ERRBASE_IC + ERRCODE_INDEXREADONLY);
  3326.   DBIERR_NOUNIQUERECS           = (ERRBASE_IC + ERRCODE_NOUNIQUERECS);
  3327.   DBIERR_NOTCURSESSION          = (ERRBASE_IC + ERRCODE_NOTCURSESSION);
  3328.   DBIERR_INVALIDKEYWORD         = (ERRBASE_IC + ERRCODE_INVALIDKEYWORD);
  3329.   DBIERR_CONNECTINUSE           = (ERRBASE_IC + ERRCODE_CONNECTINUSE);
  3330.   DBIERR_CONNECTNOTSHARED       = (ERRBASE_IC + ERRCODE_CONNECTNOTSHARED);
  3331.  
  3332.  
  3333. { ERRCAT_OS }
  3334. { ========= }
  3335. { DOS extended errors: }
  3336.  
  3337.   ERRCODE_OSEINVFNC             = 1;      { Invalid function number }
  3338.   ERRCODE_OSENOENT              = 2;      { No such file or directory }
  3339.   ERRCODE_OSENOPATH             = 3;      { Path not found }
  3340.   ERRCODE_OSEMFILE              = 4;      { Too many open files }
  3341.   ERRCODE_OSEACCES              = 5;      { Permission denied }
  3342.   ERRCODE_OSEBADF               = 6;      { Bad file number }
  3343.   ERRCODE_OSECONTR              = 7;      { Memory blocks destroyed }
  3344.   ERRCODE_OSENOMEM              = 8;      { Not enough core }
  3345.   ERRCODE_OSEINVMEM             = 9;      { Invalid memory block address }
  3346.   ERRCODE_OSEINVENV             = 10;     { 0x0a Invalid environment }
  3347.   ERRCODE_OSEINVFMT             = 11;     { 0x0b Invalid format }
  3348.   ERRCODE_OSEINVACC             = 12;     { 0x0c Invalid access code }
  3349.   ERRCODE_OSEINVDAT             = 13;     { 0x0d Invalid data }
  3350.   ERRCODE_OSENODEV              = 15;     { 0x0f No such device }
  3351.   ERRCODE_OSECURDIR             = 16;     { 0x10 Attempt to remove curdir }
  3352.   ERRCODE_OSENOTSAM             = 17;     { 0x11 Not same device }
  3353.   ERRCODE_OSENMFILE             = 18;     { 0x12 No more files }
  3354.   ERRCODE_OSEINVAL              = 19;     { 0x13 Invalid argument }
  3355.   ERRCODE_OSE2BIG               = 20;     { 0x14 Arg list too long }
  3356.   ERRCODE_OSENOEXEC             = 21;     { 0x15 Exec format error }
  3357.   ERRCODE_OSEXDEV               = 22;     { 0x16 Cross-device link }
  3358.   ERRCODE_OSEDOM                = 33;     { 0x21 Math argument }
  3359.   ERRCODE_OSERANGE              = 34;     { 0x22 Result to large }
  3360.   ERRCODE_OSEEXIST              = 35;     { 0x23 File already exists }
  3361.   ERRCODE_OSUNKNOWN             = 39;     { 0x27 Unkown | illegal error from rtl }
  3362.  
  3363.   ERRCODE_OSSHAREVIOL           = 50;     { 0x32 Share viol, ext. err 0x20 }
  3364.   ERRCODE_OSLOCKVIOL            = 51;     { 0x33 Lock viol, ext. err 0x21 }
  3365.   ERRCODE_OSINT24FAIL           = 52;     { 0x34 INT24 called }
  3366.   ERRCODE_OSDRIVENOTREADY       = 53;     { 0x35 Drive not ready }
  3367.  
  3368.  
  3369.  
  3370. { OTHER Os errors: }
  3371. { 1. idapi errors  }
  3372. { 2. errors from non-dos systems ( i.e. NOVELL ) }
  3373.  
  3374.   ERRCODE_NOTEXACT              = 100;    { 0x64 Not exact read/write }
  3375.   ERRCODE_OSNETERR              = 101;    { 0x65 Generic network error }
  3376.   ERRCODE_OSUNKNOWNSRVERR       = 102;    { 0x66 Error from file server }
  3377.   ERRCODE_SERVERNOMEMORY        = 103;    { 0x67 Server out of memory }
  3378.   ERRCODE_OSALREADYLOCKED       = 104;    { 0x68 Record already locked (by you) }
  3379.   ERRCODE_OSNOTLOCKED           = 105;    { 0x69 Record not locked }
  3380.   ERRCODE_NOSERVERSW            = 106;    { 0x6a Server software not running the workstation/server }
  3381.  
  3382.  
  3383.   DBIERR_OSEINVFNC              = ( ERRBASE_OS + ERRCODE_OSEINVFNC );
  3384.   DBIERR_OSENOENT               = ( ERRBASE_OS + ERRCODE_OSENOENT );
  3385.   DBIERR_OSENOPATH              = ( ERRBASE_OS + ERRCODE_OSENOPATH );
  3386.   DBIERR_OSEMFILE               = ( ERRBASE_OS + ERRCODE_OSEMFILE );
  3387.   DBIERR_OSEACCES               = ( ERRBASE_OS + ERRCODE_OSEACCES );
  3388.   DBIERR_OSEBADF                = ( ERRBASE_OS + ERRCODE_OSEBADF );
  3389.   DBIERR_OSECONTR               = ( ERRBASE_OS + ERRCODE_OSECONTR );
  3390.   DBIERR_OSENOMEM               = ( ERRBASE_OS + ERRCODE_OSENOMEM );
  3391.   DBIERR_OSEINVMEM              = ( ERRBASE_OS + ERRCODE_OSEINVMEM );
  3392.   DBIERR_OSEINVENV              = ( ERRBASE_OS + ERRCODE_OSEINVENV );
  3393.   DBIERR_OSEINVFMT              = ( ERRBASE_OS + ERRCODE_OSEINVFMT );
  3394.   DBIERR_OSEINVACC              = ( ERRBASE_OS + ERRCODE_OSEINVACC );
  3395.   DBIERR_OSEINVDAT              = ( ERRBASE_OS + ERRCODE_OSEINVDAT );
  3396.   DBIERR_OSENODEV               = ( ERRBASE_OS + ERRCODE_OSENODEV );
  3397.   DBIERR_OSECURDIR              = ( ERRBASE_OS + ERRCODE_OSECURDIR );
  3398.   DBIERR_OSENOTSAM              = ( ERRBASE_OS + ERRCODE_OSENOTSAM );
  3399.   DBIERR_OSENMFILE              = ( ERRBASE_OS + ERRCODE_OSENMFILE );
  3400.   DBIERR_OSEINVAL               = ( ERRBASE_OS + ERRCODE_OSEINVAL );
  3401.   DBIERR_OSE2BIG                = ( ERRBASE_OS + ERRCODE_OSE2BIG );
  3402.   DBIERR_OSENOEXEC              = ( ERRBASE_OS + ERRCODE_OSENOEXEC );
  3403.   DBIERR_OSEXDEV                = ( ERRBASE_OS + ERRCODE_OSEXDEV );
  3404.   DBIERR_OSEDOM                 = ( ERRBASE_OS + ERRCODE_OSEDOM );
  3405.   DBIERR_OSERANGE               = ( ERRBASE_OS + ERRCODE_OSERANGE );
  3406.   DBIERR_OSEEXIST               = ( ERRBASE_OS + ERRCODE_OSEEXIST );
  3407.   DBIERR_OSUNKNOWN              = ( ERRBASE_OS + ERRCODE_OSUNKNOWN );
  3408.   DBIERR_OSSHAREVIOL            = ( ERRBASE_OS + ERRCODE_OSSHAREVIOL );
  3409.   DBIERR_OSLOCKVIOL             = ( ERRBASE_OS + ERRCODE_OSLOCKVIOL );
  3410.   DBIERR_OSNETERR               = ( ERRBASE_OS + ERRCODE_OSNETERR );
  3411.   DBIERR_OSINT24FAIL            = ( ERRBASE_OS + ERRCODE_OSINT24FAIL );
  3412.   DBIERR_OSDRIVENOTREADY        = ( ERRBASE_OS + ERRCODE_OSDRIVENOTREADY );
  3413.  
  3414.  
  3415.   DBIERR_NOTEXACT               = ( ERRBASE_OS + ERRCODE_NOTEXACT );
  3416.   DBIERR_OSUNKNOWNSRVERR        = ( ERRBASE_OS + ERRCODE_OSUNKNOWNSRVERR );
  3417.   DBIERR_SERVERNOMEMORY         = ( ERRBASE_OS + ERRCODE_SERVERNOMEMORY );
  3418.   DBIERR_OSALREADYLOCKED        = ( ERRBASE_OS + ERRCODE_OSALREADYLOCKED );
  3419.   DBIERR_OSNOTLOCKED            = ( ERRBASE_OS + ERRCODE_OSNOTLOCKED );
  3420.   DBIERR_NOSERVERSW             = ( ERRBASE_OS + ERRCODE_NOSERVERSW);
  3421.  
  3422. { ERRCAT_NETWORK }
  3423. { ============== }
  3424.  
  3425.   ERRCODE_NETINITERR            = 1;      { Net init failed }
  3426.   ERRCODE_NETUSERLIMIT          = 2;      { Net user limit exceeded }
  3427.   ERRCODE_NETFILEVERSION        = 3;      { Wrong net file version }
  3428.   ERRCODE_NETFILELOCKED         = 4;      { Not able to lock net file }
  3429.   ERRCODE_DIRNOTPRIVATE         = 5;
  3430.   ERRCODE_NETMULTIPLE           = 6;      { Multiple net files in use }
  3431.   ERRCODE_NETUNKNOWN            = 7;      { Unknown net error }
  3432.   ERRCODE_SHAREDFILE            = 8;      { Cannot access a shared file }
  3433.   ERRCODE_SHARENOTLOADED        = 9;      { Share not loaded }
  3434.   ERRCODE_NOTONANETWORK         = 10;     { 0x0a Not an Network }
  3435.   ERRCODE_SQLCOMMLOST           = 11;     { 0x0b Lost Communication with SQL server }
  3436.   ERRCODE_SERVERCOMMLOST        = 12;     { 0x0c Lost Communication with IDAPI server }
  3437.   ERRCODE_SQLSERVERNOTFOUND     = 13;     { 0x0d SQL Server not found }
  3438.   ERRCODE_SERVERNOTFOUND        = 14;     { 0x0e SQL Server not found }
  3439.  
  3440.   DBIERR_NETINITERR             = (ERRBASE_NETWORK + ERRCODE_NETINITERR);
  3441.   DBIERR_NETUSERLIMIT           = (ERRBASE_NETWORK + ERRCODE_NETUSERLIMIT);
  3442.   DBIERR_NETFILEVERSION         = (ERRBASE_NETWORK + ERRCODE_NETFILEVERSION);
  3443.   DBIERR_NETFILELOCKED          = (ERRBASE_NETWORK + ERRCODE_NETFILELOCKED);
  3444.   DBIERR_DIRNOTPRIVATE          = (ERRBASE_NETWORK + ERRCODE_DIRNOTPRIVATE);
  3445.   DBIERR_NETMULTIPLE            = (ERRBASE_NETWORK + ERRCODE_NETMULTIPLE);
  3446.   DBIERR_NETUNKNOWN             = (ERRBASE_NETWORK + ERRCODE_NETUNKNOWN);
  3447.   DBIERR_SHAREDFILE             = (ERRBASE_NETWORK + ERRCODE_SHAREDFILE);
  3448.   DBIERR_SHARENOTLOADED         = (ERRBASE_NETWORK + ERRCODE_SHARENOTLOADED);
  3449.   DBIERR_NOTONANETWORK          = (ERRBASE_NETWORK + ERRCODE_NOTONANETWORK);
  3450.   DBIERR_SQLCOMMLOST            = (ERRBASE_NETWORK + ERRCODE_SQLCOMMLOST);
  3451.   DBIERR_SERVERCOMMLOST         = (ERRBASE_NETWORK + ERRCODE_SERVERCOMMLOST);
  3452.   DBIERR_SQLSERVERNOTFOUND      = (ERRBASE_NETWORK + ERRCODE_SQLSERVERNOTFOUND);
  3453.   DBIERR_SERVERNOTFOUND         = (ERRBASE_NETWORK + ERRCODE_SERVERNOTFOUND);
  3454.  
  3455. { ERRCAT_DRIVER }
  3456. { ============= }
  3457.  
  3458.   ERRCODE_WRONGDRVNAME          = 1;      { Wrong driver name }
  3459.   ERRCODE_WRONGSYSVER           = 2;      { Wrong system version }
  3460.   ERRCODE_WRONGDRVVER           = 3;      { Wrong driver version }
  3461.   ERRCODE_WRONGDRVTYPE          = 4;      { Wrong driver type }
  3462.   ERRCODE_CANNOTLOADDRV         = 5;      { Can not load driver }
  3463.   ERRCODE_CANNOTLOADLDDRV       = 6;      { Can not load language driver }
  3464.   ERRCODE_VENDINITFAIL          = 7;      { Vendor init failure }
  3465.   ERRCODE_DRIVERRESTRICTED      = 8;      { Client not enabled for this driver }
  3466.  
  3467.  
  3468.   DBIERR_WRONGDRVNAME           = (ERRBASE_DRIVER + ERRCODE_WRONGDRVNAME);
  3469.   DBIERR_WRONGSYSVER            = (ERRBASE_DRIVER + ERRCODE_WRONGSYSVER);
  3470.   DBIERR_WRONGDRVVER            = (ERRBASE_DRIVER + ERRCODE_WRONGDRVVER);
  3471.   DBIERR_WRONGDRVTYPE           = (ERRBASE_DRIVER + ERRCODE_WRONGDRVTYPE);
  3472.   DBIERR_CANNOTLOADDRV          = (ERRBASE_DRIVER + ERRCODE_CANNOTLOADDRV);
  3473.   DBIERR_CANNOTLOADLDDRV        = (ERRBASE_DRIVER + ERRCODE_CANNOTLOADLDDRV);
  3474.   DBIERR_VENDINITFAIL           = (ERRBASE_DRIVER + ERRCODE_VENDINITFAIL);
  3475.   DBIERR_DRIVERRESTRICTED       = (ERRBASE_DRIVER + ERRCODE_DRIVERRESTRICTED);
  3476.  
  3477.  
  3478. { ERRCAT_QUERY }
  3479. { ============ }
  3480.  
  3481.  
  3482.  
  3483.   DBICODE_AMBJOASY              = 1;      { obsolete }
  3484.   DBICODE_AMBJOSYM              = 2;      { obsolete }
  3485.   DBICODE_AMBOUTEX              = 3;
  3486.   DBICODE_AMBOUTPR              = 4;      { obsolete }
  3487.   DBICODE_AMBSYMAS              = 5;      { obsolete }
  3488.   DBICODE_ASETOPER              = 6;
  3489.   DBICODE_AVENUMDA              = 7;
  3490.   DBICODE_BADEXPR1              = 8;
  3491.   DBICODE_BADFLDOR              = 9;
  3492.   DBICODE_BADVNAME              = 10;     { 0x0a }
  3493.   DBICODE_BITMAPER              = 11;     { 0x0b }
  3494.   DBICODE_CALCBADR              = 12;     { 0x0c }
  3495.   DBICODE_CALCTYPE              = 13;     { 0x0d }
  3496.   DBICODE_CHGTO1TI              = 14;     { 0x0e }
  3497.   DBICODE_CHGTOCHG              = 15;     { 0x0f }
  3498.   DBICODE_CHGTOEXP              = 16;     { 0x10 }
  3499.   DBICODE_CHGTOINS              = 17;     { 0x11 }
  3500.   DBICODE_CHGTONEW              = 18;     { 0x12 }
  3501.   DBICODE_CHGTOVAL              = 19;     { 0x13 }
  3502.   DBICODE_CHKMRKFI              = 20;     { 0x14 }
  3503.   DBICODE_CHNAMBIG              = 21;     { 0x15 }
  3504.   DBICODE_CHUNKERR              = 22;     { 0x16 }
  3505.   DBICODE_COLUM255              = 23;     { 0x17 }
  3506.   DBICODE_CONAFTAS              = 24;     { 0x18 }
  3507.   DBICODE_DEL1TIME              = 25;     { 0x19 }
  3508.   DBICODE_DELAMBIG              = 26;     { 0x1a }
  3509.   DBICODE_DELFRDEL              = 27;     { 0x1b }
  3510.   DBICODE_EGFLDTYP              = 28;     { 0x1c }
  3511.   DBICODE_EXAMINOR              = 29;     { 0x1d }
  3512.   DBICODE_EXPRTYPS              = 30;     { 0x1e }
  3513.   DBICODE_EXTRACOM              = 31;     { 0x1f }
  3514.   DBICODE_EXTRAORO              = 32;     { 0x20 }
  3515.   DBICODE_EXTRAQRO              = 33;     { 0x21 }
  3516.   DBICODE_FIND1ATT              = 34;     { 0x22 }
  3517.   DBICODE_FINDANST              = 35;     { 0x23 }
  3518.   DBICODE_GRPNOSET              = 36;     { 0x24 }
  3519.   DBICODE_GRPSTROW              = 37;     { 0x25 }
  3520.   DBICODE_IDFINLCO              = 38;     { 0x26 }
  3521.   DBICODE_IDFPERLI              = 39;     { 0x27 }
  3522.   DBICODE_INANEXPR              = 40;     { 0x28 }
  3523.   DBICODE_INS1TIME              = 41;     { 0x29 }
  3524.   DBICODE_INSAMBIG              = 42;     { 0x2a }
  3525.   DBICODE_INSDELCH              = 43;     { 0x2b }
  3526.   DBICODE_INSEXPRR              = 44;     { 0x2c }
  3527.   DBICODE_INSTOINS              = 45;     { 0x2d }
  3528.   DBICODE_ISARRAY               = 46;     { 0x2e }
  3529.   DBICODE_LABELERR              = 47;     { 0x2f }
  3530.   DBICODE_LINKCALC              = 48;     { 0x30 }
  3531.   DBICODE_LNGVNAME              = 49;     { 0x31 }
  3532.   DBICODE_LONGQURY              = 50;     { 0x32 }
  3533.   DBICODE_MEMVPROC              = 51;     { 0x33 }
  3534.   DBICODE_MISNGCOM              = 52;     { 0x34 }
  3535.   DBICODE_MISNGRPA              = 53;     { 0x35 }
  3536.   DBICODE_MISSRTQU              = 54;     { 0x36 }
  3537.   DBICODE_NAMTWICE              = 55;     { 0x37 }
  3538.   DBICODE_NOCHKMAR              = 56;     { 0x38 }
  3539.   DBICODE_NODEFOCC              = 57;     { 0x39 }
  3540.   DBICODE_NOGROUPS              = 58;     { 0x3a }
  3541.   DBICODE_NONSENSE              = 59;     { 0x3b }
  3542.   DBICODE_NOPATTER              = 60;     { 0x3c }
  3543.   DBICODE_NOSUCHDA              = 61;     { 0x3d }
  3544.   DBICODE_NOVALUE               = 62;     { 0x3e }
  3545.   DBICODE_ONLYCONS              = 63;     { 0x3f }
  3546.   DBICODE_ONLYSETR              = 64;     { 0x40 }
  3547.   DBICODE_OUTSENS1              = 65;     { 0x41 }
  3548.   DBICODE_OUTTWIC1              = 66;     { 0x42 }
  3549.   DBICODE_PAROWCNT              = 67;     { 0x43 }
  3550.   DBICODE_PERSEPAR              = 68;     { 0x44 }
  3551.   DBICODE_PROCPLSW              = 69;     { 0x45 }
  3552.   DBICODE_PWINSRTS              = 70;     { 0x46 }
  3553.   DBICODE_PWMODRTS              = 71;     { 0x47 }
  3554.   DBICODE_QBEFLDFOUND           = 72;     { 0x48 }
  3555.   DBICODE_QBENOFENCE            = 73;     { 0x49 }
  3556.   DBICODE_QBENOFENCET           = 74;     { 0x4a }
  3557.   DBICODE_QBENOHEADERT          = 75;     { 0x4b }
  3558.   DBICODE_QBENOTAB              = 76;     { 0x4c }
  3559.   DBICODE_QBENUMCOLS            = 77;     { 0x4d }
  3560.   DBICODE_QBEOPENTAB            = 78;     { 0x4e }
  3561.   DBICODE_QBETWICE              = 79;     { 0x4f }
  3562.   DBICODE_QRYNOANSWER           = 80;     { 0x50 }
  3563.   DBICODE_QRYNOTPREP            = 81;     { 0x51 }
  3564.   DBICODE_QUAINDEL              = 82;     { 0x52 }
  3565.   DBICODE_QUAININS              = 83;     { 0x53 }
  3566.   DBICODE_RAGININS              = 84;     { 0x54 }
  3567.   DBICODE_RAGINSET              = 85;     { 0x55 }
  3568.   DBICODE_ROWUSERR              = 86;     { 0x56 }
  3569.   DBICODE_SETEXPEC              = 87;     { 0x57 }
  3570.   DBICODE_SETVAMB1              = 88;     { 0x58 }
  3571.   DBICODE_SETVBAD1              = 89;     { 0x59 }
  3572.   DBICODE_SETVDEF1              = 90;     { 0x5a }
  3573.   DBICODE_SUMNUMBE              = 91;     { 0x5b }
  3574.   DBICODE_TBLISWP3              = 92;     { 0x5c }
  3575.   DBICODE_TOKENNOT              = 93;     { 0x5d }
  3576.   DBICODE_TWOOUTR1              = 94;     { 0x5e }
  3577.   DBICODE_TYPEMISM              = 95;     { 0x5f }
  3578.   DBICODE_UNRELQ1               = 96;     { 0x60 }
  3579.   DBICODE_UNUSEDST              = 97;     { 0x61 }
  3580.   DBICODE_USEINSDE              = 98;     { 0x62 }
  3581.   DBICODE_USEOFCHG              = 99;     { 0x63 }
  3582.   DBICODE_VARMUSTF              = 100;    { 0x64 }
  3583.   DBICODE_REGISTER              = 101;    { 0x65 }
  3584.   DBICODE_LONGEXPR              = 102;    { 0x66 }
  3585.   DBICODE_REFRESH               = 103;    { 0x67 }
  3586.   DBICODE_CANCEXCEPT            = 104;    { 0x68 }
  3587.   DBICODE_DBEXCEPT              = 105;    { 0x69 }
  3588.   DBICODE_MEMEXCEPT             = 106;    { 0x6a }
  3589.   DBICODE_FATALEXCEPT           = 107;    { 0x6b }
  3590.   DBICODE_QRYNIY                = 108;    { 0x6c }
  3591.   DBICODE_BADFORMAT             = 109;    { 0x6d }
  3592.   DBICODE_QRYEMPTY              = 110;    { 0x6e }
  3593.   DBICODE_NOQRYTOPREP           = 111;    { 0x6f }
  3594.   DBICODE_BUFFTOOSMALL          = 112;    { 0x70 }
  3595.   DBICODE_QRYNOTPARSE           = 113;    { 0x71 }
  3596.   DBICODE_NOTHANDLE             = 114;    { 0x72 }
  3597.   DBICODE_QRYSYNTERR            = 115;    { 0x73 }
  3598.   DBICODE_QXFLDCOUNT            = 116;    { 0x74 }
  3599.   DBICODE_QXFLDSYMNOTFOUND      = 117;    { 0x75 }
  3600.   DBICODE_QXTBLSYMNOTFOUND      = 118;    { 0x76 }
  3601.   DBICODE_BLOBTERM              = 119;    { 0x77 }
  3602.   DBICODE_BLOBERR               = 120;    { 0x78 }
  3603.   DBICODE_RESTARTQRY            = 121;    { 0x79 }
  3604.   DBICODE_UNKNOWNANSTYPE        = 122;    { 0x7a }
  3605.  
  3606. { Internal QBE use Only. }
  3607.   DBICODE_SQLG_MDIST            = 123;    { 0x7b }
  3608.   DBICODE_SQLG_NOARI            = 124;    { 0x7c }
  3609.   DBICODE_SQLG_LIKEN            = 125;    { 0x7d }
  3610.   DBICODE_SQLG_ALPHO            = 126;    { 0x7e }
  3611.   DBICODE_SQLG_DATEO            = 127;    { 0x7f }
  3612.   DBICODE_SQLG_RELOP            = 128;    { 0x80 }
  3613.   DBICODE_SQLG_ONLYC            = 129;    { 0x81 }
  3614.   DBICODE_SQLG_CNTLN            = 130;    { 0x82 }
  3615.   DBICODE_SQLG_CHINI            = 131;    { 0x83 }
  3616.   DBICODE_SQLG_UNION            = 132;    { 0x84 }
  3617.   DBICODE_SQLG_SLFIN            = 133;    { 0x85 }
  3618.   DBICODE_SQLG_OTJVR            = 134;    { 0x86 }
  3619.   DBICODE_SQLG_STROW            = 135;    { 0x87 }
  3620.   DBICODE_SQLG_QUANT            = 136;    { 0x88 }
  3621.   DBICODE_SQLG_REGSO            = 137;    { 0x89 }
  3622.   DBICODE_SQLG_COUNT            = 138;    { 0x8a }
  3623.   DBICODE_SQLG_AVERA            = 139;    { 0x8b }
  3624.   DBICODE_SQLG_DATEA            = 140;    { 0x8c }
  3625.   DBICODE_SQLG_BADPT            = 141;    { 0x8d }
  3626.   DBICODE_SQLG_RELPA            = 142;    { 0x8e }
  3627.   DBICODE_SQLG_PATRN            = 143;    { 0x8f }
  3628.   DBICODE_SQLG_FNDSU            = 144;    { 0x90 }
  3629.   DBICODE_SQLG_IFDCS            = 145;    { 0x91 }
  3630.   DBICODE_SQLG_IDCCO            = 146;    { 0x92 }
  3631.   DBICODE_SQLG_ONLYI            = 147;    { 0x93 }
  3632.   DBICODE_SQLG_SQLDIALECT       = 148;    { 0x94 }
  3633.   DBICODE_SQLG_NOQUERY          = 149;    { 0x95 }
  3634. { End of Internal.       }
  3635.  
  3636.   DBICODE_BLOBGROUP             = 150;    { 0x96 }
  3637.   DBICODE_QRYNOPROP             = 151;    { 0x97 }
  3638.   DBICODE_ANSTYPNOTSUP          = 152;    { 0x98 }
  3639.   DBICODE_ANSALIASNOTSUP        = 153;    { 0x99 }
  3640.   DBICODE_INSBLOBREQ            = 154;    { 0x9a }
  3641.   DBICODE_CHGUNIQUENDXREQ       = 155;    { 0x9b }
  3642.   DBICODE_DELUNIQUENDXREQ       = 156;    { 0x9c }
  3643.   DBICODE_SQLNOFULLUPDATE       = 157;    { 0x9d }
  3644.   DBICODE_CANTEXECREMOTE        = 158;    { 0x9e }
  3645.   DBICODE_UNEXPECTEDEOC         = 159;    { 0x9f }
  3646.   DBICODE_SQLPARAMNOTSET        = 160;    { 0xA0 }
  3647.   DBICODE_QUERYTOOLONG          = 161;    { 0xA1 }
  3648.  
  3649. { Errors added for localsql }
  3650.   DBICODE_NOSUCHRELORALIAS      = 170;
  3651.   DBICODE_TYPEAMBIGUITY         = 171;
  3652.   DBICODE_ORDERBYNOTAPROJ       = 172;
  3653.   DBICODE_SQLPARSE              = 173;
  3654.   DBICODE_CONSTRAINTFAILED      = 174;
  3655.   DBICODE_NOTGROUPINGFIELD      = 175;
  3656.   DBICODE_UDFNOTDEFINED         = 176;
  3657.   DBICODE_UDFERROR              = 177;
  3658.   DBICODE_SINGLEROWERROR        = 178;
  3659.   DBICODE_GROUPEXPR             = 179;
  3660.   DBICODE_QUERYTEXT             = 180;
  3661.   DBICODE_ANSIJOINSUP           = 181;
  3662.   DBICODE_DISTUNION             = 182;
  3663.   DBICODE_GROUPBYREQ            = 183;
  3664.   DBICODE_INSUPDAUTOIC          = 184;
  3665.   DBICODE_UPDREFINTSINGLE       = 185;
  3666.  
  3667. { Errors added for query builder }
  3668.   DBICODE_TOOFEWSUBEXPR         = 190;    { 0xBE }
  3669.   DBICODE_TOOMANYSUBEXPR        = 191;    { 0xBF }
  3670.   DBICODE_INVALIDNODETYPE       = 192;    { 0xC0 }
  3671.   DBICODE_BOOLEXPR              = 193;    { 0xC1 }
  3672.   DBICODE_NONBOOLEXPR           = 194;    { 0xC2 }
  3673.   DBICODE_NOOUTERJOIN           = 195;    { 0xC3 }
  3674.  
  3675.   DBIERR_AMBJOASY               = (ERRBASE_QUERY+DBICODE_AMBJOASY);
  3676.   DBIERR_AMBJOSYM               = (ERRBASE_QUERY+DBICODE_AMBJOSYM);
  3677.   DBIERR_AMBOUTEX               = (ERRBASE_QUERY+DBICODE_AMBOUTEX);
  3678.   DBIERR_AMBOUTPR               = (ERRBASE_QUERY+DBICODE_AMBOUTPR);
  3679.   DBIERR_AMBSYMAS               = (ERRBASE_QUERY+DBICODE_AMBSYMAS);
  3680.   DBIERR_ASETOPER               = (ERRBASE_QUERY+DBICODE_ASETOPER);
  3681.   DBIERR_AVENUMDA               = (ERRBASE_QUERY+DBICODE_AVENUMDA);
  3682.   DBIERR_BADEXPR1               = (ERRBASE_QUERY+DBICODE_BADEXPR1);
  3683.   DBIERR_BADFLDOR               = (ERRBASE_QUERY+DBICODE_BADFLDOR);
  3684.   DBIERR_BADVNAME               = (ERRBASE_QUERY+DBICODE_BADVNAME);
  3685.   DBIERR_BITMAPER               = (ERRBASE_QUERY+DBICODE_BITMAPER);
  3686.   DBIERR_CALCBADR               = (ERRBASE_QUERY+DBICODE_CALCBADR);
  3687.   DBIERR_CALCTYPE               = (ERRBASE_QUERY+DBICODE_CALCTYPE);
  3688.   DBIERR_CHGTO1TI               = (ERRBASE_QUERY+DBICODE_CHGTO1TI);
  3689.   DBIERR_CHGTOCHG               = (ERRBASE_QUERY+DBICODE_CHGTOCHG);
  3690.   DBIERR_CHGTOEXP               = (ERRBASE_QUERY+DBICODE_CHGTOEXP);
  3691.   DBIERR_CHGTOINS               = (ERRBASE_QUERY+DBICODE_CHGTOINS);
  3692.   DBIERR_CHGTONEW               = (ERRBASE_QUERY+DBICODE_CHGTONEW);
  3693.   DBIERR_CHGTOVAL               = (ERRBASE_QUERY+DBICODE_CHGTOVAL);
  3694.   DBIERR_CHKMRKFI               = (ERRBASE_QUERY+DBICODE_CHKMRKFI);
  3695.   DBIERR_CHNAMBIG               = (ERRBASE_QUERY+DBICODE_CHNAMBIG);
  3696.   DBIERR_CHUNKERR               = (ERRBASE_QUERY+DBICODE_CHUNKERR);
  3697.   DBIERR_COLUM255               = (ERRBASE_QUERY+DBICODE_COLUM255);
  3698.   DBIERR_CONAFTAS               = (ERRBASE_QUERY+DBICODE_CONAFTAS);
  3699.   DBIERR_DEL1TIME               = (ERRBASE_QUERY+DBICODE_DEL1TIME);
  3700.   DBIERR_DELAMBIG               = (ERRBASE_QUERY+DBICODE_DELAMBIG);
  3701.   DBIERR_DELFRDEL               = (ERRBASE_QUERY+DBICODE_DELFRDEL);
  3702.   DBIERR_EGFLDTYP               = (ERRBASE_QUERY+DBICODE_EGFLDTYP);
  3703.   DBIERR_EXAMINOR               = (ERRBASE_QUERY+DBICODE_EXAMINOR);
  3704.   DBIERR_EXPRTYPS               = (ERRBASE_QUERY+DBICODE_EXPRTYPS);
  3705.   DBIERR_EXTRACOM               = (ERRBASE_QUERY+DBICODE_EXTRACOM);
  3706.   DBIERR_EXTRAORO               = (ERRBASE_QUERY+DBICODE_EXTRAORO);
  3707.   DBIERR_EXTRAQRO               = (ERRBASE_QUERY+DBICODE_EXTRAQRO);
  3708.   DBIERR_FIND1ATT               = (ERRBASE_QUERY+DBICODE_FIND1ATT);
  3709.   DBIERR_FINDANST               = (ERRBASE_QUERY+DBICODE_FINDANST);
  3710.   DBIERR_GRPNOSET               = (ERRBASE_QUERY+DBICODE_GRPNOSET);
  3711.   DBIERR_GRPSTROW               = (ERRBASE_QUERY+DBICODE_GRPSTROW);
  3712.   DBIERR_IDFINLCO               = (ERRBASE_QUERY+DBICODE_IDFINLCO);
  3713.   DBIERR_IDFPERLI               = (ERRBASE_QUERY+DBICODE_IDFPERLI);
  3714.   DBIERR_INANEXPR               = (ERRBASE_QUERY+DBICODE_INANEXPR);
  3715.   DBIERR_INS1TIME               = (ERRBASE_QUERY+DBICODE_INS1TIME);
  3716.   DBIERR_INSAMBIG               = (ERRBASE_QUERY+DBICODE_INSAMBIG);
  3717.   DBIERR_INSDELCH               = (ERRBASE_QUERY+DBICODE_INSDELCH);
  3718.   DBIERR_INSEXPRR               = (ERRBASE_QUERY+DBICODE_INSEXPRR);
  3719.   DBIERR_INSTOINS               = (ERRBASE_QUERY+DBICODE_INSTOINS);
  3720.   DBIERR_ISARRAY                = (ERRBASE_QUERY+DBICODE_ISARRAY);
  3721.   DBIERR_LABELERR               = (ERRBASE_QUERY+DBICODE_LABELERR);
  3722.   DBIERR_LINKCALC               = (ERRBASE_QUERY+DBICODE_LINKCALC);
  3723.   DBIERR_LNGVNAME               = (ERRBASE_QUERY+DBICODE_LNGVNAME);
  3724.   DBIERR_LONGQURY               = (ERRBASE_QUERY+DBICODE_LONGQURY);
  3725.   DBIERR_MEMVPROC               = (ERRBASE_QUERY+DBICODE_MEMVPROC);
  3726.   DBIERR_MISNGCOM               = (ERRBASE_QUERY+DBICODE_MISNGCOM);
  3727.   DBIERR_MISNGRPA               = (ERRBASE_QUERY+DBICODE_MISNGRPA);
  3728.   DBIERR_MISSRTQU               = (ERRBASE_QUERY+DBICODE_MISSRTQU);
  3729.   DBIERR_NAMTWICE               = (ERRBASE_QUERY+DBICODE_NAMTWICE);
  3730.   DBIERR_NOCHKMAR               = (ERRBASE_QUERY+DBICODE_NOCHKMAR);
  3731.   DBIERR_NODEFOCC               = (ERRBASE_QUERY+DBICODE_NODEFOCC);
  3732.   DBIERR_NOGROUPS               = (ERRBASE_QUERY+DBICODE_NOGROUPS);
  3733.   DBIERR_NONSENSE               = (ERRBASE_QUERY+DBICODE_NONSENSE);
  3734.   DBIERR_NOPATTER               = (ERRBASE_QUERY+DBICODE_NOPATTER);
  3735.   DBIERR_NOSUCHDA               = (ERRBASE_QUERY+DBICODE_NOSUCHDA);
  3736.   DBIERR_NOVALUE                = (ERRBASE_QUERY+DBICODE_NOVALUE);
  3737.   DBIERR_ONLYCONS               = (ERRBASE_QUERY+DBICODE_ONLYCONS);
  3738.   DBIERR_ONLYSETR               = (ERRBASE_QUERY+DBICODE_ONLYSETR);
  3739.   DBIERR_OUTSENS1               = (ERRBASE_QUERY+DBICODE_OUTSENS1);
  3740.   DBIERR_OUTTWIC1               = (ERRBASE_QUERY+DBICODE_OUTTWIC1);
  3741.   DBIERR_PAROWCNT               = (ERRBASE_QUERY+DBICODE_PAROWCNT);
  3742.   DBIERR_PERSEPAR               = (ERRBASE_QUERY+DBICODE_PERSEPAR);
  3743.   DBIERR_PROCPLSW               = (ERRBASE_QUERY+DBICODE_PROCPLSW);
  3744.   DBIERR_PWINSRTS               = (ERRBASE_QUERY+DBICODE_PWINSRTS);
  3745.   DBIERR_PWMODRTS               = (ERRBASE_QUERY+DBICODE_PWMODRTS);
  3746.   DBIERR_QBEFLDFOUND            = (ERRBASE_QUERY+DBICODE_QBEFLDFOUND);
  3747.   DBIERR_QBENOFENCE             = (ERRBASE_QUERY+DBICODE_QBENOFENCE);
  3748.   DBIERR_QBENOFENCET            = (ERRBASE_QUERY+DBICODE_QBENOFENCET);
  3749.   DBIERR_QBENOHEADERT           = (ERRBASE_QUERY+DBICODE_QBENOHEADERT);
  3750.   DBIERR_QBENOTAB               = (ERRBASE_QUERY+DBICODE_QBENOTAB);
  3751.   DBIERR_QBENUMCOLS             = (ERRBASE_QUERY+DBICODE_QBENUMCOLS);
  3752.   DBIERR_QBEOPENTAB             = (ERRBASE_QUERY+DBICODE_QBEOPENTAB);
  3753.   DBIERR_QBETWICE               = (ERRBASE_QUERY+DBICODE_QBETWICE);
  3754.   DBIERR_QRYNOANSWER            = (ERRBASE_QUERY+DBICODE_QRYNOANSWER);
  3755.   DBIERR_QRYNOTPREP             = (ERRBASE_QUERY+DBICODE_QRYNOTPREP);
  3756.   DBIERR_QUAINDEL               = (ERRBASE_QUERY+DBICODE_QUAINDEL);
  3757.   DBIERR_QUAININS               = (ERRBASE_QUERY+DBICODE_QUAININS);
  3758.   DBIERR_RAGININS               = (ERRBASE_QUERY+DBICODE_RAGININS);
  3759.   DBIERR_RAGINSET               = (ERRBASE_QUERY+DBICODE_RAGINSET);
  3760.   DBIERR_ROWUSERR               = (ERRBASE_QUERY+DBICODE_ROWUSERR);
  3761.   DBIERR_SETEXPEC               = (ERRBASE_QUERY+DBICODE_SETEXPEC);
  3762.   DBIERR_SETVAMB1               = (ERRBASE_QUERY+DBICODE_SETVAMB1);
  3763.   DBIERR_SETVBAD1               = (ERRBASE_QUERY+DBICODE_SETVBAD1);
  3764.   DBIERR_SETVDEF1               = (ERRBASE_QUERY+DBICODE_SETVDEF1);
  3765.   DBIERR_SUMNUMBE               = (ERRBASE_QUERY+DBICODE_SUMNUMBE);
  3766.   DBIERR_TBLISWP3               = (ERRBASE_QUERY+DBICODE_TBLISWP3);
  3767.   DBIERR_TOKENNOT               = (ERRBASE_QUERY+DBICODE_TOKENNOT);
  3768.   DBIERR_TWOOUTR1               = (ERRBASE_QUERY+DBICODE_TWOOUTR1);
  3769.   DBIERR_TYPEMISM               = (ERRBASE_QUERY+DBICODE_TYPEMISM);
  3770.   DBIERR_UNRELQ1                = (ERRBASE_QUERY+DBICODE_UNRELQ1);
  3771.   DBIERR_UNUSEDST               = (ERRBASE_QUERY+DBICODE_UNUSEDST);
  3772.   DBIERR_USEINSDE               = (ERRBASE_QUERY+DBICODE_USEINSDE);
  3773.   DBIERR_USEOFCHG               = (ERRBASE_QUERY+DBICODE_USEOFCHG);
  3774.   DBIERR_VARMUSTF               = (ERRBASE_QUERY+DBICODE_VARMUSTF);
  3775.   DBIERR_REGISTER               = (ERRBASE_QUERY+DBICODE_REGISTER);
  3776.   DBIERR_LONGEXPR               = (ERRBASE_QUERY+DBICODE_LONGEXPR);
  3777.   DBIERR_REFRESH                = (ERRBASE_QUERY+DBICODE_REFRESH);
  3778.   DBIERR_CANCEXCEPT             = (ERRBASE_QUERY+DBICODE_CANCEXCEPT);
  3779.   DBIERR_DBEXCEPT               = (ERRBASE_QUERY+DBICODE_DBEXCEPT);
  3780.   DBIERR_MEMEXCEPT              = (ERRBASE_QUERY+DBICODE_MEMEXCEPT);
  3781.   DBIERR_FATALEXCEPT            = (ERRBASE_QUERY+DBICODE_FATALEXCEPT);
  3782.   DBIERR_QRYNIY                 = (ERRBASE_QUERY+ DBICODE_QRYNIY);
  3783.   DBIERR_BADFORMAT              = (ERRBASE_QUERY+ DBICODE_BADFORMAT);
  3784.   DBIERR_QRYEMPTY               = (ERRBASE_QUERY+ DBICODE_QRYEMPTY);
  3785.   DBIERR_NOQRYTOPREP            = (ERRBASE_QUERY+ DBICODE_NOQRYTOPREP);
  3786.   DBIERR_BUFFTOOSMALL           = (ERRBASE_QUERY+ DBICODE_BUFFTOOSMALL);
  3787.   DBIERR_QRYNOTPARSE            = (ERRBASE_QUERY+ DBICODE_QRYNOTPARSE);
  3788.   DBIERR_NOTHANDLE              = (ERRBASE_QUERY+ DBICODE_NOTHANDLE);
  3789.   DBIERR_QRYSYNTERR             = (ERRBASE_QUERY+ DBICODE_QRYSYNTERR);
  3790.   DBIERR_QXFLDCOUNT             = (ERRBASE_QUERY+ DBICODE_QXFLDCOUNT);
  3791.   DBIERR_QXFLDSYMNOTFOUND       = (ERRBASE_QUERY+ DBICODE_QXFLDSYMNOTFOUND);
  3792.   DBIERR_QXTBLSYMNOTFOUND       = (ERRBASE_QUERY+ DBICODE_QXTBLSYMNOTFOUND);
  3793.   DBIERR_BLOBTERM               = (ERRBASE_QUERY+ DBICODE_BLOBTERM);
  3794.   DBIERR_BLOBERR                = (ERRBASE_QUERY+ DBICODE_BLOBERR);
  3795.   DBIERR_RESTARTQRY             = (ERRBASE_QUERY+ DBICODE_RESTARTQRY);
  3796.   DBIERR_UNKNOWNANSTYPE         = (ERRBASE_QUERY+ DBICODE_UNKNOWNANSTYPE);
  3797.   DBIERR_SQLG_MDIST             = (ERRBASE_QUERY+ DBICODE_SQLG_MDIST);
  3798.   DBIERR_SQLG_NOARI             = (ERRBASE_QUERY+ DBICODE_SQLG_NOARI);
  3799.   DBIERR_SQLG_LIKEN             = (ERRBASE_QUERY+ DBICODE_SQLG_LIKEN);
  3800.   DBIERR_SQLG_ALPHO             = (ERRBASE_QUERY+ DBICODE_SQLG_ALPHO);
  3801.   DBIERR_SQLG_DATEO             = (ERRBASE_QUERY+ DBICODE_SQLG_DATEO);
  3802.   DBIERR_SQLG_RELOP             = (ERRBASE_QUERY+ DBICODE_SQLG_RELOP);
  3803.   DBIERR_SQLG_ONLYC             = (ERRBASE_QUERY+ DBICODE_SQLG_ONLYC);
  3804.   DBIERR_SQLG_CNTLN             = (ERRBASE_QUERY+ DBICODE_SQLG_CNTLN);
  3805.   DBIERR_SQLG_CHINI             = (ERRBASE_QUERY+ DBICODE_SQLG_CHINI);
  3806.   DBIERR_SQLG_UNION             = (ERRBASE_QUERY+ DBICODE_SQLG_UNION);
  3807.   DBIERR_SQLG_SLFIN             = (ERRBASE_QUERY+ DBICODE_SQLG_SLFIN);
  3808.   DBIERR_SQLG_OTJVR             = (ERRBASE_QUERY+ DBICODE_SQLG_OTJVR);
  3809.   DBIERR_SQLG_STROW             = (ERRBASE_QUERY+ DBICODE_SQLG_STROW);
  3810.   DBIERR_SQLG_QUANT             = (ERRBASE_QUERY+ DBICODE_SQLG_QUANT);
  3811.   DBIERR_SQLG_REGSO             = (ERRBASE_QUERY+ DBICODE_SQLG_REGSO);
  3812.   DBIERR_SQLG_COUNT             = (ERRBASE_QUERY+ DBICODE_SQLG_COUNT);
  3813.   DBIERR_SQLG_AVERA             = (ERRBASE_QUERY+ DBICODE_SQLG_AVERA);
  3814.   DBIERR_SQLG_DATEA             = (ERRBASE_QUERY+ DBICODE_SQLG_DATEA);
  3815.   DBIERR_SQLG_BADPT             = (ERRBASE_QUERY+ DBICODE_SQLG_BADPT);
  3816.   DBIERR_SQLG_RELPA             = (ERRBASE_QUERY+ DBICODE_SQLG_RELPA);
  3817.   DBIERR_SQLG_PATRN             = (ERRBASE_QUERY+ DBICODE_SQLG_PATRN);
  3818.   DBIERR_SQLG_FNDSU             = (ERRBASE_QUERY+ DBICODE_SQLG_FNDSU);
  3819.   DBIERR_SQLG_IFDCS             = (ERRBASE_QUERY+ DBICODE_SQLG_IFDCS);
  3820.   DBIERR_SQLG_IDCCO             = (ERRBASE_QUERY+ DBICODE_SQLG_IDCCO);
  3821.   DBIERR_SQLG_ONLYI             = (ERRBASE_QUERY+ DBICODE_SQLG_ONLYI);
  3822.   DBIERR_SQLG_SQLDIALECT        = (ERRBASE_QUERY+ DBICODE_SQLG_SQLDIALECT);
  3823.   DBIERR_SQLG_NOQUERY           = (ERRBASE_QUERY+ DBICODE_SQLG_NOQUERY);
  3824.   DBIERR_BLOBGROUP              = (ERRBASE_QUERY+ DBICODE_BLOBGROUP);
  3825.   DBIERR_QRYNOPROP              = (ERRBASE_QUERY+DBICODE_QRYNOPROP);
  3826.   DBIERR_ANSTYPNOTSUP           = (ERRBASE_QUERY+DBICODE_ANSTYPNOTSUP);
  3827.   DBIERR_ANSALIASNOTSUP         = (ERRBASE_QUERY+DBICODE_ANSALIASNOTSUP);
  3828.   DBIERR_INSBLOBREQ             = (ERRBASE_QUERY+DBICODE_INSBLOBREQ     ); { 0x9a }
  3829.   DBIERR_CHGUNIQUENDXREQ        = (ERRBASE_QUERY+DBICODE_CHGUNIQUENDXREQ); { 0x9b }
  3830.   DBIERR_DELUNIQUENDXREQ        = (ERRBASE_QUERY+DBICODE_DELUNIQUENDXREQ); { 0x9c }
  3831.   DBIERR_SQLNOFULLUPDATE        = (ERRBASE_QUERY+DBICODE_SQLNOFULLUPDATE); { 0x9d }
  3832.   DBIERR_CANTEXECREMOTE         = (ERRBASE_QUERY+DBICODE_CANTEXECREMOTE); { 0x9e }
  3833.   DBIERR_UNEXPECTEDEOC          = (ERRBASE_QUERY+DBICODE_UNEXPECTEDEOC);
  3834.   DBIERR_SQLPARAMNOTSET         = (ERRBASE_QUERY+DBICODE_SQLPARAMNOTSET);
  3835.   DBIERR_QUERYTOOLONG           = (ERRBASE_QUERY+DBICODE_QUERYTOOLONG);
  3836.  
  3837.   DBIERR_NOSUCHRELORALIAS       = (ERRBASE_QUERY+DBICODE_NOSUCHRELORALIAS);
  3838.   DBIERR_TYPEAMBIGUITY          = (ERRBASE_QUERY+DBICODE_TYPEAMBIGUITY);
  3839.   DBIERR_ORDERBYNOTAPROJ        = (ERRBASE_QUERY+DBICODE_ORDERBYNOTAPROJ);
  3840.   DBIERR_SQLPARSE               = (ERRBASE_QUERY+DBICODE_SQLPARSE);
  3841.   DBIERR_CONSTRAINTFAILED       = (ERRBASE_QUERY+DBICODE_CONSTRAINTFAILED);
  3842.   DBIERR_NOTGROUPINGFIELD       = (ERRBASE_QUERY+DBICODE_NOTGROUPINGFIELD);
  3843.   DBIERR_UDFNOTDEFINED          = (ERRBASE_QUERY+DBICODE_UDFNOTDEFINED);
  3844.   DBIERR_UDFERROR               = (ERRBASE_QUERY+DBICODE_UDFERROR);
  3845.   DBIERR_SINGLEROWERROR         = (ERRBASE_QUERY+DBICODE_SINGLEROWERROR);
  3846.   DBIERR_GROUPEXPR              = (ERRBASE_QUERY+DBICODE_GROUPEXPR);
  3847.   DBIERR_QUERYTEXT              = (ERRBASE_QUERY+DBICODE_QUERYTEXT);
  3848.   DBIERR_ANSIJOINSUP            = (ERRBASE_QUERY+DBICODE_ANSIJOINSUP);
  3849.   DBIERR_DISTUNION              = (ERRBASE_QUERY+DBICODE_DISTUNION);
  3850.   DBIERR_GROUPBYREQ             = (ERRBASE_QUERY+DBICODE_GROUPBYREQ);
  3851.   DBIERR_INSUPDAUTOINC          = (ERRBASE_QUERY+DBICODE_INSUPDAUTOIC);
  3852.   DBIERR_UPDREFINTSINGLE        = (ERRBASE_QUERY+DBICODE_UPDREFINTSINGLE);
  3853.  
  3854.   DBIERR_TOOFEWSUBEXPR          = (ERRBASE_QUERY+DBICODE_TOOFEWSUBEXPR);
  3855.   DBIERR_TOOMANYSUBEXPR         = (ERRBASE_QUERY+DBICODE_TOOMANYSUBEXPR);
  3856.   DBIERR_INVALIDNODETYPE        = (ERRBASE_QUERY+DBICODE_INVALIDNODETYPE);
  3857.   DBIERR_BOOLEXPR               = (ERRBASE_QUERY+DBICODE_BOOLEXPR);
  3858.   DBIERR_NONBOOLEXPR            = (ERRBASE_QUERY+DBICODE_NONBOOLEXPR);
  3859.   DBIERR_NOOUTERJOIN            = (ERRBASE_QUERY+DBICODE_NOOUTERJOIN);
  3860.  
  3861.  
  3862. { END_OF_QUERY_MESSAGES }
  3863.  
  3864. { ERRCAT_VERSION }
  3865. { ============== }
  3866.  
  3867.   ERRCODE_INTERFACEVER          = 1;      { Interface mismatch }
  3868.   ERRCODE_INDEXOUTOFDATE        = 2;      { Index is out of date }
  3869.   ERRCODE_OLDVERSION            = 3;      { Older version (see context) }
  3870.   ERRCODE_VALFILEINVALID        = 4;      { Val. file is out of date }
  3871.   ERRCODE_BLOBVERSION           = 5;      { Old Blob file version }
  3872.   ERRCODE_ENGQRYMISMATCH        = 6;      { Query and IDAPI are mismatched }
  3873.   ERRCODE_SERVERVERSION         = 7;      { Server is incompatible version }
  3874.   ERRCODE_TABLELEVEL            = 8;      { Higher table level required }
  3875.  
  3876.   DBIERR_INTERFACEVER           = (ERRBASE_VERSION + ERRCODE_INTERFACEVER);
  3877.   DBIERR_INDEXOUTOFDATE         = (ERRBASE_VERSION + ERRCODE_INDEXOUTOFDATE);
  3878.   DBIERR_OLDVERSION             = (ERRBASE_VERSION + ERRCODE_OLDVERSION);
  3879.   DBIERR_VALFILEINVALID         = (ERRBASE_VERSION + ERRCODE_VALFILEINVALID);
  3880.   DBIERR_BLOBVERSION            = (ERRBASE_VERSION + ERRCODE_BLOBVERSION);
  3881.   DBIERR_ENGQRYMISMATCH         = (ERRBASE_VERSION + ERRCODE_ENGQRYMISMATCH);
  3882.   DBIERR_SERVERVERSION          = (ERRBASE_VERSION + ERRCODE_SERVERVERSION);
  3883.   DBIERR_TABLELEVEL             = (ERRBASE_VERSION + ERRCODE_TABLELEVEL);
  3884.  
  3885. { ERRCAT_CAPABILITY }
  3886. { ================= }
  3887.  
  3888.   ERRCODE_NOTSUPPORTED          = 1;      { Capability not supported }
  3889.   ERRCODE_NIY                   = 2;      { Not Implemented Yet }
  3890.   ERRCODE_TABLESQL              = 3;      { Cannot access SQL replica }
  3891.   ERRCODE_SEARCHCOLREQD         = 4;      { Searchable (Non-blob column) required }
  3892.   ERRCODE_NOMULTCONNECT         = 5;      { Multiple connections not supported }
  3893.   ERRCODE_NODBASEEXPR           = 6;      { Full dBASE Expressions not supported }
  3894.  
  3895.   DBIERR_NOTSUPPORTED           = (ERRBASE_CAPABILITY + ERRCODE_NOTSUPPORTED);
  3896.   DBIERR_NIY                    = (ERRBASE_CAPABILITY + ERRCODE_NIY);
  3897.   DBIERR_TABLESQL               = (ERRBASE_CAPABILITY + ERRCODE_TABLESQL);
  3898.   DBIERR_SEARCHCOLREQD          = (ERRBASE_CAPABILITY + ERRCODE_SEARCHCOLREQD);
  3899.   DBIERR_NOMULTCONNECT          = (ERRBASE_CAPABILITY + ERRCODE_NOMULTCONNECT);
  3900.   DBIERR_NODBASEEXPR            = (ERRBASE_CAPABILITY + ERRCODE_NODBASEEXPR);
  3901.  
  3902. { ERRCAT_CONFIG }
  3903. { ============= }
  3904.  
  3905.   ERRCODE_INVALIDDBSPEC         = 1;
  3906.   ERRCODE_UNKNOWNDBTYPE         = 2;
  3907.   ERRCODE_INVALIDSYSDATA        = 3;
  3908.   ERRCODE_UNKNOWNNETTYPE        = 4;
  3909.   ERRCODE_NOTONTHATNET          = 5;
  3910.   ERRCODE_INVALIDCFGPARAM       = 6;      { Generic invalid config param }
  3911.  
  3912.  
  3913.   DBIERR_INVALIDDBSPEC          = (ERRBASE_CONFIG + ERRCODE_INVALIDDBSPEC);
  3914.   DBIERR_UNKNOWNDBTYPE          = (ERRBASE_CONFIG + ERRCODE_UNKNOWNDBTYPE);
  3915.   DBIERR_INVALIDSYSDATA         = (ERRBASE_CONFIG + ERRCODE_INVALIDSYSDATA);
  3916.   DBIERR_UNKNOWNNETTYPE         = (ERRBASE_CONFIG + ERRCODE_UNKNOWNNETTYPE);
  3917.   DBIERR_NOTONTHATNET           = (ERRBASE_CONFIG + ERRCODE_NOTONTHATNET);
  3918.   DBIERR_INVALIDCFGPARAM        = (ERRBASE_CONFIG + ERRCODE_INVALIDCFGPARAM);
  3919.  
  3920. { ERRCAT_WARNING  non-fatal warnings:               }
  3921. { warn user of action, or ask for optional behavior }
  3922. { ================================================= }
  3923.   ERRCODE_OBJIMPLICITLYDROPPED  = 1;
  3924.   ERRCODE_OBJMAYBETRUNCATED     = 2;
  3925.   ERRCODE_OBJIMPLICITLYMODIFIED = 3;
  3926.   ERRCODE_VALIDATEDATA          = 4;
  3927.   ERRCODE_VALFIELDMODIFIED      = 5;
  3928.   ERRCODE_TABLELEVELCHANGED     = 6;
  3929.   ERRCODE_COPYLINKEDTABLES      = 7;
  3930.   ERRCODE_OTHERSERVERLOADED     = 8;
  3931.   ERRCODE_OBJIMPLICITLYTRUNCATED = 9;
  3932.   ERRCODE_VCHKMAYNOTBEENFORCED  = 10;
  3933.   ERRCODE_MULTIPLEUNIQRECS      = 11;
  3934.   ERRCODE_FIELDMUSTBETRIMMED    = 12;
  3935.  
  3936.   DBIERR_OBJIMPLICITLYDROPPED   = ( ERRBASE_WARNING + ERRCODE_OBJIMPLICITLYDROPPED);
  3937.   DBIERR_OBJMAYBETRUNCATED      = ( ERRBASE_WARNING + ERRCODE_OBJMAYBETRUNCATED);
  3938.   DBIERR_OBJIMPLICITLYMODIFIED  = ( ERRBASE_WARNING + ERRCODE_OBJIMPLICITLYMODIFIED);
  3939.   DBIERR_VALIDATEDATA           = ( ERRBASE_WARNING + ERRCODE_VALIDATEDATA);
  3940.   DBIERR_VALFIELDMODIFIED       = ( ERRBASE_WARNING + ERRCODE_VALFIELDMODIFIED);
  3941.   DBIERR_TABLELEVELCHANGED      = ( ERRBASE_WARNING + ERRCODE_TABLELEVELCHANGED);
  3942.   DBIERR_COPYLINKEDTABLES       = ( ERRBASE_WARNING + ERRCODE_COPYLINKEDTABLES);
  3943.   DBIERR_OTHERSERVERLOADED      = ( ERRBASE_WARNING + ERRCODE_OTHERSERVERLOADED);
  3944.   DBIERR_OBJIMPLICITLYTRUNCATED = ( ERRBASE_WARNING + ERRCODE_OBJIMPLICITLYTRUNCATED);
  3945.   DBIERR_VCHKMAYNOTBEENFORCED   = ( ERRBASE_WARNING + ERRCODE_VCHKMAYNOTBEENFORCED );
  3946.   DBIERR_MULTIPLEUNIQRECS       = ( ERRBASE_WARNING + ERRCODE_MULTIPLEUNIQRECS );
  3947.   DBIERR_FIELDMUSTBETRIMMED     = ( ERRBASE_WARNING + ERRCODE_FIELDMUSTBETRIMMED );
  3948.  
  3949.  
  3950. { ERRCAT_OTHER }
  3951. { ============ }
  3952.  
  3953.   ERRCODE_FILEEXISTS            = 1;      { File already exsits }
  3954.   ERRCODE_BLOBMODIFIED          = 2;      { Another user modified Blob }
  3955.   ERRCODE_UNKNOWNSQL            = 3;      { Unknown SQL error }
  3956.   ERRCODE_TABLEEXISTS           = 4;      { Table already exsits }
  3957.   ERRCODE_PDX10TABLE            = 5;      { Paradox 1.0 tables not supported }
  3958.   ERRCODE_UPDATEABORT           = 6;      { Update operation aborted }
  3959.  
  3960.  
  3961.   DBIERR_FILEEXISTS             = (ERRBASE_OTHER + ERRCODE_FILEEXISTS);
  3962.   DBIERR_BLOBMODIFIED           = (ERRBASE_OTHER + ERRCODE_BLOBMODIFIED);
  3963.   DBIERR_UNKNOWNSQL             = (ERRBASE_OTHER + ERRCODE_UNKNOWNSQL);
  3964.   DBIERR_TABLEEXISTS            = (ERRBASE_OTHER + ERRCODE_TABLEEXISTS);
  3965.   DBIERR_PDX10TABLE             = (ERRBASE_OTHER + ERRCODE_PDX10TABLE);
  3966.   DBIERR_UPDATEABORT            = (ERRBASE_OTHER + ERRCODE_UPDATEABORT);
  3967.  
  3968.  
  3969. { ERRCAT_COMPATIBILITY }
  3970. { ==================== }
  3971.  
  3972.   ERRCODE_DIFFSORTORDER         = 1;      { Sortorders not compatible }
  3973.   ERRCODE_DIRINUSEBYOLDVER      = 2;      { Directory in use by old version }
  3974.   ERRCODE_PDX35LDDRIVER         = 3;      { Needs Pdox 3.5 compatible language driver }
  3975.  
  3976.   DBIERR_DIFFSORTORDER          = (ERRBASE_COMPATIBILITY + ERRCODE_DIFFSORTORDER);
  3977.   DBIERR_DIRINUSEBYOLDVER       = (ERRBASE_COMPATIBILITY + ERRCODE_DIRINUSEBYOLDVER);
  3978.   DBIERR_PDX35LDDRIVER          = (ERRBASE_COMPATIBILITY + ERRCODE_PDX35LDDRIVER);
  3979.  
  3980. { ERRCAT_OPTPARAM }
  3981. { =============== }
  3982.  
  3983.   ERRCODE_REQOPTPARAM           = 1;      { Required optional parameter missing }
  3984.   ERRCODE_INVALIDOPTPARAM       = 2;      { Optional param out-of-range or bad }
  3985.  
  3986.  
  3987.   DBIERR_REQOPTPARAM            = (ERRBASE_OPTPARAM + ERRCODE_REQOPTPARAM);
  3988.   DBIERR_INVALIDOPTPARAM        = (ERRBASE_OPTPARAM + ERRCODE_INVALIDOPTPARAM);
  3989.  
  3990. {  ERRCAT_REPOSITORY }
  3991. {  ================= }
  3992.  
  3993.   ERRCODE_REPOSITORYCORRUPT     = 1;    { Data Repository is corrupt }
  3994.   ERRCODE_INFOBLOBCORRUPT       = 2;    { Info Blob corrupted }
  3995.   ERRCODE_SCHEMACORRUPT         = 3;    { DR Schema is corrupt }
  3996.   ERRCODE_ATTRTYPEEXISTS        = 4;    { Attribute Type exists }
  3997.   ERRCODE_INVALIDOBJTYPE        = 5;    { Invalid Object Type }
  3998.   ERRCODE_INVALIDRELATIONTYPE   = 6;    { Invalid Relation Type }
  3999.   ERRCODE_VIEWEXISTS            = 7;    { View already exists }
  4000.   ERRCODE_NOSUCHVIEW            = 8;    { No such View exists }
  4001.   ERRCODE_INVALIDRECCONSTRAINT  = 9;    { Invalid Record Constraint }
  4002.   ERRCODE_LDBCONNECTION         = 10;   { Object is in a Logical DB }
  4003.   ERRCODE_REPOSITORYEXISTS      = 11;   { Repository already exists }
  4004.   ERRCODE_NOSUCHREPOSITORY      = 12;   { Repository does not exist }
  4005.   ERRCODE_REPOSITORYDBMISSING   = 13;   { Repository database does not exist }
  4006.   ERRCODE_REPOSITORYOUTOFDATE   = 14;   { Repository info is out of date }
  4007.   ERRCODE_REPOSITORYVERSION     = 15;   { DR Version mismatch }
  4008.   ERRCODE_REPOSITORYNAME        = 16;   { Invalid Repository name }
  4009.   ERRCODE_DEPENDENTOBJECTS      = 17;   { Dependent Objects exist }
  4010.   ERRCODE_RELATIONLIMIT         = 18;   { Too many Relationships for this Object Type }
  4011.   ERRCODE_RELATIONSHIPSEXIST    = 19;   { Relationships to the Object exist }
  4012.   ERRCODE_EXCHANGEFILECORRUPT   = 20;   { Exchange File Corrupt }
  4013.   ERRCODE_EXCHANGEFILEVERSION   = 21;   { Exchange File Version Mismatch }
  4014.   ERRCODE_TYPEMISMATCH          = 22;   { Exchange File and Repository Types don't match }
  4015.   ERRCODE_OBJECTEXISTS          = 23;   { Object Exists in the Target Repository }
  4016.   ERRCODE_REPOSITORYACCESS      = 24;   { Access to Repository Denied }
  4017.   ERRCODE_REPOSITORYCREATE      = 25;   { Cannot Create Repository }
  4018.   ERRCODE_DATABASEOPENFAILED    = 26;   { Cannot Open a Database }
  4019.  
  4020.  
  4021.   DBIERR_REPOSITORYCORRUPT      = (ERRBASE_REPOSITORY + ERRCODE_REPOSITORYCORRUPT);
  4022.   DBIERR_INFOBLOBCORRUPT        = (ERRBASE_REPOSITORY + ERRCODE_INFOBLOBCORRUPT);
  4023.   DBIERR_SCHEMACORRUPT          = (ERRBASE_REPOSITORY + ERRCODE_SCHEMACORRUPT);
  4024.   DBIERR_ATTRTYPEEXISTS         = (ERRBASE_REPOSITORY + ERRCODE_ATTRTYPEEXISTS);
  4025.   DBIERR_INVALIDOBJTYPE         = (ERRBASE_REPOSITORY + ERRCODE_INVALIDOBJTYPE);
  4026.   DBIERR_INVALIDRELATIONTYPE    = (ERRBASE_REPOSITORY + ERRCODE_INVALIDRELATIONTYPE);
  4027.   DBIERR_VIEWEXISTS             = (ERRBASE_REPOSITORY + ERRCODE_VIEWEXISTS);
  4028.   DBIERR_NOSUCHVIEW             = (ERRBASE_REPOSITORY + ERRCODE_NOSUCHVIEW);
  4029.   DBIERR_INVALIDRECCONSTRAINT   = (ERRBASE_REPOSITORY + ERRCODE_INVALIDRECCONSTRAINT);
  4030.   DBIERR_LDBCONNECTION          = (ERRBASE_REPOSITORY + ERRCODE_LDBCONNECTION);
  4031.   DBIERR_REPOSITORYEXISTS       = (ERRBASE_REPOSITORY + ERRCODE_REPOSITORYEXISTS);
  4032.   DBIERR_NOSUCHREPOSITORY       = (ERRBASE_REPOSITORY + ERRCODE_NOSUCHREPOSITORY);
  4033.   DBIERR_REPOSITORYDBMISSING    = (ERRBASE_REPOSITORY + ERRCODE_REPOSITORYDBMISSING);
  4034.   DBIERR_REPOSITORYOUTOFDATE    = (ERRBASE_REPOSITORY + ERRCODE_REPOSITORYOUTOFDATE);
  4035.   DBIERR_REPOSITORYVERSION      = (ERRBASE_REPOSITORY + ERRCODE_REPOSITORYVERSION);
  4036.   DBIERR_REPOSITORYNAME         = (ERRBASE_REPOSITORY + ERRCODE_REPOSITORYNAME);
  4037.   DBIERR_DEPENDENTOBJECTS       = (ERRBASE_REPOSITORY + ERRCODE_DEPENDENTOBJECTS);
  4038.   DBIERR_RELATIONLIMIT          = (ERRBASE_REPOSITORY + ERRCODE_RELATIONLIMIT);
  4039.   DBIERR_RELATIONSHIPSEXIST     = (ERRBASE_REPOSITORY + ERRCODE_RELATIONSHIPSEXIST);
  4040.   DBIERR_EXCHANGEFILECORRUPT    = (ERRBASE_REPOSITORY + ERRCODE_EXCHANGEFILECORRUPT);
  4041.   DBIERR_EXCHANGEFILEVERSION    = (ERRBASE_REPOSITORY + ERRCODE_EXCHANGEFILEVERSION);
  4042.   DBIERR_TYPEMISMATCH           = (ERRBASE_REPOSITORY + ERRCODE_TYPEMISMATCH);
  4043.   DBIERR_OBJECTEXISTS           = (ERRBASE_REPOSITORY + ERRCODE_OBJECTEXISTS);
  4044.   DBIERR_REPOSITORYACCESS       = (ERRBASE_REPOSITORY + ERRCODE_REPOSITORYACCESS);
  4045.   DBIERR_REPOSITORYCREATE       = (ERRBASE_REPOSITORY + ERRCODE_REPOSITORYCREATE);
  4046.   DBIERR_DATABASEOPENFAILED     = (ERRBASE_REPOSITORY + ERRCODE_DATABASEOPENFAILED);
  4047.  
  4048. {============================================================================}
  4049. {                          DBI prototypes                                    }
  4050. {============================================================================}
  4051. {                          Environmental                                     }
  4052. {----------------------------------------------------------------------------}
  4053.  
  4054. function DbiInitFn (                    { Initialize the Engine }
  4055.       iVer          : Word;             { Interface Version }
  4056.       pEnv          : pDBIEnv           { Environment Structure/NULL }
  4057.    ): DBIResult stdcall;
  4058.  
  4059.  { DO NOT CALL THIS DIRECTLY. Use the 'DbiInit' define below. }
  4060.  
  4061.  { Initializes the engine environment. Default settings can be overwritten  }
  4062.  { by supplying the appropriate settings. Defaults are read from the system }
  4063.  { configuration file. pEnv can be NULLP to get the system defautls.        }
  4064.  
  4065. function DbiInit (pEnv: PDbiEnv): DBIResult stdcall;
  4066.  
  4067. function DbiExit: DBIResult stdcall;            { Exit engine }
  4068.  
  4069. function DbiDLLExit: DBIResult stdcall;         { Exit DLL }
  4070.  
  4071. {============================================================================}
  4072. {                         System Level Info                                  }
  4073. {============================================================================}
  4074.  
  4075. function DbiGetSysVersion (             { Get system version info }
  4076. var   sysVersion    : SYSVersion
  4077.    ): DBIResult stdcall;
  4078.  
  4079. function DbiGetSysConfig (              { System configuration }
  4080. var   sysConfig     : SYSConfig
  4081.    ): DBIResult stdcall;
  4082.  
  4083. function DbiGetClientInfo (             { Get Client info }
  4084. var   clientInfo    : CLIENTInfo
  4085.    ): DBIResult stdcall;
  4086.  
  4087. function DbiGetSysInfo (                { Get system status/info }
  4088. var   sysInfo       : SYSInfo
  4089.    ): DBIResult stdcall;
  4090.  
  4091. function DbiLoadDriver (                { Load a given driver }
  4092.       pszDriverType : PChar             { Driver name }
  4093.    ): DBIResult stdcall;
  4094.  
  4095. {============================================================================}
  4096. {                            Sessions                                        }
  4097. {============================================================================}
  4098.  
  4099. function DbiStartSession (              { Start a new session }
  4100.       pszName       : PChar;            { Name (Optional) }
  4101. var   hSes          : hDBISes;          { Session }
  4102.       pNetDir       : PChar             { Netfile directory for session (opt) }
  4103.    ): DBIResult stdcall;
  4104.  
  4105. function DbiGetCurrSession (            { Get the current session }
  4106. var   hSes          : hDBISes           { Session }
  4107.    ): DBIResult stdcall;
  4108.  
  4109. function DbiSetCurrSession (            { Set the current session }
  4110.       hSes          : hDBISes           { Session/NULL }
  4111.    ): DBIResult stdcall;
  4112.  
  4113. function DbiCloseSession (              { Close the current session }
  4114.       hSes          : hDBISes           { Session }
  4115.    ): DBIResult stdcall;
  4116.  
  4117. function DbiGetSesInfo (                { Get current session info }
  4118. var   sesInfo       : SESInfo
  4119.    ): DBIResult stdcall;
  4120.  
  4121. function DbiSetPrivateDir (             { Set Private Directory for session }
  4122.       pszDir        : PChar             { Directory name/NULL }
  4123.    ): DBIResult stdcall;
  4124.  
  4125.  
  4126. {============================================================================}
  4127. {                     Datababase, Schema and File inquiry                    }
  4128. {============================================================================}
  4129.  
  4130. function DbiOpenDatabase (              { Open a database }
  4131.       pszDbName     : PChar;            { Database name }
  4132.       pszDbType     : PChar;            { Database type (NULL: Universal) }
  4133.       eOpenMode     : DBIOpenMode;      { Open type }
  4134.       eShareMode    : DBIShareMode;     { Share type }
  4135.       pszPassword   : PChar;            { Password }
  4136.       iOptFlds      : Word;             { Number of optional Params }
  4137.       pOptFldDesc   : pFLDDesc;         { Optional Field Descriptors }
  4138.       pOptParams    : Pointer;          { Optional Params }
  4139. var   hDb           : hDBIDb            { Returnd database handle }
  4140.    ): DBIResult stdcall;
  4141.  
  4142. function DbiSetDirectory (              { Set the current directory }
  4143.       hDb           : hDBIDb;           { Universal database handle }
  4144.       pszDir        : PChar             { Directory/NULL }
  4145.    ): DBIResult stdcall;
  4146.  
  4147. function DbiGetDirectory (              { Get the current/default directory }
  4148.       hDb           : hDBIDb;           { Universal database handle }
  4149.       bDefault      : Bool;             { True for default }
  4150.       pszDir        : PChar             { Returned directory }
  4151.    ): DBIResult stdcall;
  4152.  
  4153. function DbiOpenTableList (             { Open a cursor on "Tables" }
  4154.       hDb           : hDBIDb;           { Database handle }
  4155.       bExtended     : Bool;             { True for extended info }
  4156.       bSystem       : Bool;             { True to include system tables }
  4157.       pszWild       : PChar;            { Wild card name }
  4158. var   hCur          : hDBICur           { Returned cursor }
  4159.    ): DBIResult stdcall;
  4160.  
  4161. function DbiOpenFileList (              { Open a cursor on "Files" }
  4162.       hDb           : hDBIDb;           { Universal database handle }
  4163.       pszWild       : PChar;            { Wild card name }
  4164. var   hCur          : hDBICur           { Returned cursor }
  4165.    ): DBIResult stdcall;
  4166.  
  4167. function DbiOpenIndexList (             { Return "Indexes" for a table }
  4168.       hDb           : hDBIDb;           { Database handle }
  4169.       pszTableName  : PChar;            { Table name }
  4170.       pszDriverType : PChar;            { Driver type }
  4171. var   hCur          : hDBICur           { Returned cursor on "Indexes" }
  4172.    ): DBIResult stdcall;
  4173.  
  4174. function DbiOpenFieldList (             { Return "Fields" for a table }
  4175.       hDb           : hDBIDb;           { Database handle }
  4176.       pszTableName  : PChar;            { Table name }
  4177.       pszDriverType : PChar;            { Driver type }
  4178.       bPhyTypes     : Bool;             { True, for physical types }
  4179. var   hCur          : hDBICur           { Returned cursor on "Fields" }
  4180.    ): DBIResult stdcall;
  4181.  
  4182. function DbiOpenVchkList (              { Return "Checks" for a table }
  4183.       hDb           : hDBIDb;           { Database handle }
  4184.       pszTableName  : PChar;            { Table name }
  4185.       pszDriverType : PChar;            { Driver Type }
  4186. var   hChkCur       : hDBICur           { Returned cursor on "Checks" }
  4187.    ): DBIResult stdcall;
  4188.  
  4189. function DbiOpenRintList (              { Return Integrity checks }
  4190.       hDb           : hDBIDb;           { Database handle }
  4191.       pszTableName  : PChar;            { Table name }
  4192.       pszDriverType : PChar;            { Driver type }
  4193. var   hChkCur       : hDBICur           { Returned cursor on "Ref Int". }
  4194.    ): DBIResult stdcall;
  4195.  
  4196. function DbiOpenSecurityList (          { Return security descriptions }
  4197.       hDb           : hDBIDb;           { Database handle }
  4198.       pszTableName  : PChar;            { Table name }
  4199.       pszDriverType : PChar;            { Driver type }
  4200. var   hSecCur       : hDBICur           { Returned cursor on sec list }
  4201.    ): DBIResult stdcall;
  4202.  
  4203. function DbiOpenFamilyList (            { Return family members }
  4204.       hDb           : hDBIDb;           { Database handle }
  4205.       pszTableName  : PChar;            { Table name }
  4206.       pszDriverType : PChar;            { Driver type }
  4207. var   hFmlCur       : hDBICur           { Returned cursor on "Family" }
  4208.    ): DBIResult stdcall;
  4209.  
  4210. function DbiOpenSPList (                { Open a cursor on "Stored Procedures" }
  4211.       hDb           : hDBIDb;           { Universal database handle }
  4212.       bExtended     : Bool;             { True for extended info (N/A) }
  4213.       bSystem       : Bool;             { True to include system procedures }
  4214.       pszQual       : PChar;            { Qualifier (N/A) }
  4215. var   hCur          : hDBICur           { Returned cursor }
  4216.    ): DBIResult stdcall;
  4217.  
  4218. function DbiOpenSPParamList (           { Return "Parameters" for a stored procedure }
  4219.       hDb           : hDBIDb;           { Database handle }
  4220.       pszSPName     : PChar;            { Stored procedure name }
  4221.       bPhyTypes     : Bool;             { True, for physical types }
  4222.       uOverload     : Word;             { Overload number }
  4223. var   hCur          : hDBICur           { Returned cursor on "Parameters" }
  4224.    ): DBIResult stdcall;
  4225.  
  4226. function DbiOpenFunctionList (          { Open a cursor on "Functions" }
  4227.       hDb           : hDBIDb;           { Universal database handle }
  4228.       eoptBits      : DBIFUNCOpts;      { Options for function list }
  4229.       phCur         : phDBICur          { Returned cursor on "Functions" }
  4230.                                         { Record desc is of type DBIFUNCDesc }
  4231.    ): DBIResult stdcall;
  4232.  
  4233. function DbiOpenFunctionArgList (       { Return "Arguments" for a function }
  4234.       hDb           : hDBIDb;           { Database handle }
  4235.       pszFuncName   : PChar;            { Function name }
  4236.       uOverload     : Word;             { Overload number }
  4237.       phCur         : phDBICur          { Returned cursor on "Arguments" }
  4238.    ): DBIResult stdcall;
  4239.  
  4240. function DbiCloseDatabase (             { Close a database }
  4241. var   hDb           : hDBIDb            { Pointer to database handle }
  4242.    ): DBIResult stdcall;
  4243.  
  4244. {============================================================================}
  4245. {                                  Capabilities                              }
  4246. {============================================================================}
  4247.  
  4248. function DbiOpenDriverList (            { Get a list of driver names }
  4249. var   hCur          : hDBICur           { Returned cursor }
  4250.    ): DBIResult stdcall;
  4251.  
  4252. function DbiGetDriverDesc (             { Get description for a given type }
  4253.       pszDriverType : PChar;            { Symbolic name for driver type }
  4254. var   drvType       : DRVType           { Driver type description }
  4255.    ): DBIResult stdcall;
  4256.  
  4257. function DbiOpenDatabaseList (          { Get a list of registered databases }
  4258. var   hCur          : hDBICur           { Returned cursor }
  4259.    ): DBIResult stdcall;
  4260.  
  4261. function DbiGetDatabaseDesc (           { Get a description of a logical db }
  4262.       pszName       : PChar;            { Name of logical database }
  4263.       pdbDesc       : pDBDesc           { Database description }
  4264.    ): DBIResult stdcall;
  4265.  
  4266. function DbiOpenTableTypesList (        { Get a list of table types }
  4267.       pszDriverType : PChar;            { Driver type }
  4268. var   hCur          : hDBICur           { Returned cursor }
  4269.    ): DBIResult stdcall;
  4270.  
  4271. function DbiGetTableTypeDesc (          { Get Table capabilities }
  4272.       pszDriverType : PChar;            { Driver type }
  4273.       pszTableType  : PChar;            { Table type }
  4274. var   tblType       : TBLType           { Table Capabilities }
  4275.    ): DBIResult stdcall;
  4276.  
  4277.  
  4278. function DbiOpenFieldTypesList (        { Get a list of field types }
  4279.       pszDriverType : PChar;            { Driver type }
  4280.       pszTblType    : PChar;            { Table type (Optional) }
  4281. var   hCur          : hDBICur           { Returned cursor }
  4282.    ): DBIResult stdcall;
  4283.  
  4284. function DbiGetFieldTypeDesc (          { Get list of field types }
  4285.       pszDriverType : PChar;            { Driver type }
  4286.       pszTableType  : PChar;            { Table type }
  4287.       pszFieldType  : PChar;            { Field type  (Physical only) }
  4288. var   fldType       : FLDType           { Field type description }
  4289.    ): DBIResult stdcall;
  4290.  
  4291. function DbiOpenIndexTypesList (        { Get list of index types }
  4292.       pszDriverType : PChar;            { Driver type }
  4293. var   hCur          : hDBICur           { Returned cursor }
  4294.    ): DBIResult stdcall;
  4295.  
  4296. function DbiGetIndexTypeDesc (          { Get description of given idx type }
  4297.       pszDriverType : PChar;            { Driver type }
  4298.       pszIndexType  : PChar;            { Index type }
  4299. var   idxType       : IDXType           { Index description }
  4300.    ): DBIResult stdcall;
  4301.  
  4302. function DbiOpenLdList (                { Get a list of Lang Drivers }
  4303. var   hCur          : hDBICur           { Returned cursor }
  4304.    ): DBIResult stdcall;
  4305.  
  4306. {===========================================================================}
  4307. {                      Table Open, Properties & Structure                   }
  4308. {===========================================================================}
  4309.  
  4310. function DbiOpenTable (                 { Open a table }
  4311.       hDb           : hDBIDb;           { Database handle }
  4312.       pszTableName  : PChar;            { Table name or file name }
  4313.       pszDriverType : PChar;            { Driver type                 /NULL }
  4314.       pszIndexName  : PChar;            { Index to be used for access /NULL }
  4315.       pszIndexTagName : PChar;          { Index tag name              /NULL }
  4316.       iIndexId      : Word;             { Index number                /0 }
  4317.       eOpenMode     : DBIOpenMode;      { Read or RW }
  4318.       eShareMode    : DBIShareMode;     { Excl or Share }
  4319.       exltMode      : XLTMode;          { Xlate mode }
  4320.       bUniDirectional : Bool;           { Uni or Bi directional }
  4321.       pOptParams    : Pointer;          { Optional params /NULL }
  4322. var   hCursor       : hDBICur           { Returns Cursor handle }
  4323.    ): DBIResult stdcall;
  4324.  
  4325.  
  4326. function DbiGetCursorProps (            { Get Cursor properties }
  4327.       hCursor       : hDBICur;          { Cursor handle }
  4328. var   curProps      : CURProps          { Cursor properties }
  4329.    ): DBIResult stdcall;
  4330.  
  4331. function DbiGetObjFromName (            { Get object from name }
  4332.       eObjType      : DBIOBJType;       { Object handle }
  4333.       pszObjName    : PChar;            { Name of object /NULL }
  4334. var   hObj          : hDBIObj           { Returned object handle }
  4335.    ): DBIResult stdcall;
  4336.  
  4337. function DbiGetObjFromObj (             { Get associated object }
  4338.       hObj          : hDBIObj;          { Object handle }
  4339.       eObjType      : DBIOBJType;       { Type of associated object }
  4340. var   hObjOut       : hDBIObj           { Returns object of eObjType }
  4341.    ): DBIResult stdcall;
  4342.  
  4343. function DbiGetProp (                   { Get property }
  4344.       hObj          : hDBIObj;          { Object handle }
  4345.       iProp         : Longint;          { Property to retrieve }
  4346.       PropValue     : Pointer;          { == NULL, validate iProp for getting }
  4347.       iMaxLen       : Word;             { Length of buffer pPropValue }
  4348. var   iLen          : Word              { Returns required length }
  4349.    ): DBIResult stdcall;
  4350.  
  4351. function DbiSetProp (                   { Set property }
  4352.       hObj          : hDBIObj;          { Object handle }
  4353.       iProp         : Longint;          { Property to set }
  4354.       iPropValue    : Longint           { Property value }
  4355.    ): DBIResult stdcall;
  4356.  
  4357. function DbiValidateProp (              { Validate a property }
  4358.       hObj          : hDBIObj;          { Object handle }
  4359.       iProp         : Longint;          { property to validate }
  4360.       bSetting      : Bool              { TRUE:setting, FALSE:getting }
  4361.    ): DBIResult stdcall;
  4362.  
  4363. function DbiGetFieldDescs (             { Get field descriptions }
  4364.       hCursor       : hDBICur;          { Cursor handle }
  4365.       pfldDesc      : pFLDDesc          { Array of field descriptors }
  4366.    ): DBIResult stdcall;
  4367.  
  4368. function DbiGetCursorForTable (         { Find cursor for a given table }
  4369.       hDb           : hDBIDb;           { Database handle }
  4370.       pszTableName  : PChar;            { Table name }
  4371.       pszDriverType : PChar;            { Driver type / NULL }
  4372. var   hCursor       : hDBICur           { Returned cursor }
  4373.    ): DBIResult stdcall;
  4374.  
  4375. function DbiCloneCursor (               { Return a duplicate cursor }
  4376.       hCurSrc       : hDBICur;          { Source cursor }
  4377.       bReadOnly     : Bool;             { If TRUE, read only mode }
  4378.       bUniDirectional : Bool;           { If TRUE, Uni directional }
  4379. var   hCurNew       : hDBICur           { Destination cursor address }
  4380.    ): DBIResult stdcall;
  4381.  
  4382. function DbiCloseCursor (               { Closes cursor }
  4383. var   hCursor       : hDBICur           { Pntr to Cursor handle }
  4384.    ): DBIResult stdcall;
  4385.  
  4386.  
  4387. {============================================================================}
  4388. {                      Index Manipulation & Usage                            }
  4389. {============================================================================}
  4390.  
  4391. function DbiOpenIndex (                 { Open an index }
  4392.       hCursor       : hDBICur;          { Cursor handle }
  4393.       pszIndexName  : PChar;            { Index Name }
  4394.       iIndexId      : Word              { Index number (if applicable) }
  4395.    ): DBIResult stdcall;
  4396.  
  4397. function DbiCloseIndex (                { Close an index }
  4398.       hCursor       : hDBICur;          { Cursor handle }
  4399.       pszIndexName  : PChar;            { Index Name }
  4400.       iIndexId      : Word              { Index number }
  4401.    ): DBIResult stdcall;
  4402.  
  4403. function DbiSwitchToIndex (             { Change index order of access }
  4404. var   hCursor       : hDBICur;          { Cursor handle (In/Out) }
  4405.       pszIndexName  : PChar;            { Index name }
  4406.       pszTagName    : PChar;            { Tag name (if applicable) }
  4407.       iIndexId      : Word;             { Index number }
  4408.       bCurrRec      : Bool              { Position at current rec }
  4409.    ): DBIResult stdcall;
  4410.  
  4411. function DbiGetIndexDesc (              { Get index properties }
  4412.       hCursor       : hDBICur;          { Cursor handle }
  4413.       iIndexSeqNo   : Word;             { Index number }
  4414. var   idxDesc       : IDXDesc           { Returned index description }
  4415.    ): DBIResult stdcall;
  4416.  
  4417. function DbiGetIndexDescs (             { Get index properties }
  4418.       hCursor       : hDBICur;          { Cursor handle }
  4419.       idxDesc       : PIDXDesc          { Returned index descriptors }
  4420.    ): DBIResult stdcall;
  4421.  
  4422. function DbiGetIndexForField (          { Get index desc for given field }
  4423.       hCursor       : hDBICur;          { Cursor handle }
  4424.       iFld          : Word;             { Field Number (1..N) }
  4425.       bProdTagOnly  : Bool;             { If TRUE, only xBASE prod tags will be returned }
  4426. var   idxDesc       : IDXDesc           { (Optional) }
  4427.    ): DBIResult stdcall;
  4428.  
  4429. function DbiGetIndexSeqNo (             { Get index sequence number }
  4430.       hCursor       : hDBICur;          { Cursor handle }
  4431.       pszIndexName  : PChar;            { Index name }
  4432.       pszTagName    : PChar;            { Tag name (if applicable) }
  4433.       iIndexId      : Word;             { Index number }
  4434. var   iIndexSeqNo   : Word              { Index number }
  4435.    ): DBIResult stdcall;
  4436.  
  4437. function DbiSetToKey (                  { Set key condition }
  4438.       hCursor       : hDBICur;          { Cursor handle }
  4439.       eSearchCond   : DBISearchCond;    { Search condition (default is =) }
  4440.       bDirectKey    : Bool;             { Key is supplied directly }
  4441.       iFields       : Word;             { No of full fields to match }
  4442.       iLen          : Word;             { Partial key len of last field }
  4443.       pBuff         : Pointer           { Either Record buffer or Key itself }
  4444.    ): DBIResult stdcall;
  4445.  
  4446. function DbiExtractKey (                { Get the key value of current record }
  4447.       hCursor       : hDBICur;          { Cursor handle }
  4448.       pRecBuf       : Pointer;          { Record buffer (optional) }
  4449.       pKeyBuf       : Pointer           { Returned. Key bytes. }
  4450.    ): DBIResult stdcall;
  4451.  
  4452. function DbiSetRange (                  { Set cursor to a range }
  4453.       hCursor       : hDBICur;          { Cursor }
  4454.       bKeyItself    : Bool;             { Whether Key or Record buffer }
  4455.       iFields1      : Word;             { Key fields to be mathced in full }
  4456.       iLen1         : Word;             { Key length to compare }
  4457.       pKey1         : Pointer;          { Top/Left key in Range }
  4458.       bKey1Incl     : Bool;             { If Inclusive of Key1 }
  4459.       iFields2      : Word;             { Key fields to be mathced in full }
  4460.       iLen2         : Word;             { Key length to compare }
  4461.       pKey2         : Pointer;          { Bottom/Right key in Range }
  4462.       bKey2Incl     : Bool              { If Inclusive of Key2 }
  4463.    ): DBIResult stdcall;
  4464.  
  4465. function DbiResetRange (                { Reset range }
  4466.       hCursor       : hDBICur           { cursor handle }
  4467.    ): DBIResult stdcall;
  4468.  
  4469. function DbiCompareKeys (               { Compare two keys }
  4470.       hCursor       : hDBICur;          { Cursor handle }
  4471.       pKey1         : Pointer;          { Key buffer 1 to compare }
  4472.       pKey2         : Pointer;          { Key buffer 2 (Or NULL) }
  4473.       iFields       : Word;             { Fields to compare in full }
  4474.       iLen          : Word;             { Partial key to compare }
  4475. var   iResult       : SmallInt          { Compare result }
  4476.    ): DBIResult stdcall;
  4477.  
  4478. function DbiGetRecordForKey (           { Find a record matching key }
  4479.       hCursor       : hDBICur;          { Cursor handle }
  4480.       bDirectKey    : Bool;             { Key is supplied directly }
  4481.       iFields       : Word;             { No of full fields to match }
  4482.       iLen          : Word;             { Partial key len of last field }
  4483.       pKey          : Pointer;          { Either Record buffer or Key itself }
  4484.       pRecBuff      : Pointer           { (Optional) Record buffer }
  4485.    ): DBIResult stdcall;
  4486.  
  4487. {=============================================================================}
  4488. {                          Validity check and referential integrity           }
  4489. {=============================================================================}
  4490.  
  4491. function DbiGetVchkDesc (               { Get valcheck descriptor }
  4492.       hCursor       : hDBICur;          { Cursor handle }
  4493.       iValSeqNo     : Word;             { Valcheck sequence number }
  4494.       pvalDesc      : pVCHKDesc         { Returned valcheck description }
  4495.    ): DBIResult stdcall;
  4496.  
  4497. function DbiGetRintDesc (               { Get referential integrity descriptor }
  4498.       hCursor       : hDBICur;          { Cursor handle }
  4499.       iRintSeqNo    : Word;             { Rint sequence number }
  4500.       printDesc     : pRINTDesc         { Returned rint description }
  4501.    ): DBIResult stdcall;
  4502.  
  4503. {=============================================================================}
  4504. {                              Cursor Maintenance                             }
  4505. {=============================================================================}
  4506.  
  4507.  
  4508. function DbiSetToBegin (                { Reset cursor to beginning }
  4509.       hCursor       : hDBICur           { Cursor handle }
  4510.    ): DBIResult stdcall;
  4511.  
  4512. function DbiSetToEnd (                  { Reset cursor to ending }
  4513.       hCursor       : hDBICur           { Cursor handle }
  4514.    ): DBIResult stdcall;
  4515.  
  4516. function DbiSetToCursor (               { Set cursor to another cursor position }
  4517.       hDest         : hDBICur;          { Destination cursor }
  4518.       hSrc          : hDBICur           { Source cursor }
  4519.    ): DBIResult stdcall;
  4520.  
  4521. function DbiGetBookMark (               { Get a book-mark }
  4522.       hCur          : hDBICur;          { Cursor }
  4523.       pBookMark     : Pointer           { Pointer to Book-Mark }
  4524.    ): DBIResult stdcall;
  4525.  
  4526. function DbiSetToBookMark (             { Position to a Book-Mark }
  4527.       hCur          : hDBICur;          { Cursor }
  4528.       pBookMark     : Pointer           { Pointer to Book-Mark }
  4529.    ): DBIResult stdcall;
  4530.  
  4531. function DbiCompareBookMarks (          { Compare two Book-marks }
  4532.       hCur          : hDBICur;          { Cursor }
  4533.       pBookMark1    : Pointer;          { Book mark 1 }
  4534.       pBookMark2    : Pointer;          { Book mark 2 }
  4535. var   CmpBkmkResult : CmpBkmkRslt       { Compare result }
  4536.    ): DBIResult stdcall;
  4537.  
  4538. {============================================================================}
  4539. {                      Data Access: Logical Record Level                     }
  4540. {============================================================================}
  4541.  
  4542.  
  4543. function DbiGetNextRecord (             { Find/Get the next record }
  4544.       hCursor       : hDBICur;          { Cursor handle }
  4545.       eLock         : DBILockType;      { Optional lock request }
  4546.       pRecBuff      : Pointer;          { Record buffer(client) }
  4547.       precProps     : pRECProps         { Optional record properties }
  4548.    ): DBIResult stdcall;
  4549.  
  4550. function DbiGetPriorRecord (            { Find/Get the prior record }
  4551.       hCursor       : hDBICur;          { Cursor handle }
  4552.       eLock         : DBILockType;      { Optional lock request }
  4553.       pRecBuff      : Pointer;          { Record buffer (client) }
  4554.       precProps     : pRECProps         { Optional record properties }
  4555.    ): DBIResult stdcall;
  4556.  
  4557. function DbiGetRecord (                 { Gets the current record }
  4558.       hCursor       : hDBICur;          { Cursor handle }
  4559.       eLock         : DBILockType;      { Optional lock request }
  4560.       pRecBuff      : Pointer;          { Record buffer(client) }
  4561.       precProps     : pRECProps         { Optional record properties }
  4562.    ): DBIResult stdcall;
  4563.  
  4564. function DbiGetRelativeRecord (         { Find/Get a record by record number }
  4565.       hCursor       : hDBICur;          { Cursor handle }
  4566.       iPosOffset    : Longint;          { offset from current position }
  4567.       eLock         : DBILockType;      { Optional lock request }
  4568.       pRecBuff      : Pointer;          { Record buffer(client) }
  4569.       precProps     : pRECProps         { Optional record properties }
  4570.    ): DBIResult stdcall;
  4571.  
  4572. function DbiInitRecord (                { Initialize record area }
  4573.       hCursor       : hDBICur;          { Cursor handle }
  4574.       pRecBuff      : Pointer           { Record buffer }
  4575.    ): DBIResult stdcall;
  4576.  
  4577. function DbiInsertRecord (              { Inserts a new record }
  4578.       hCursor       : hDBICur;          { Cursor handle }
  4579.       eLock         : DBILockType;      { Optional lock on this rec }
  4580.       pRecBuff      : Pointer           { New Record (client) }
  4581.    ): DBIResult stdcall;
  4582.  
  4583. function DbiModifyRecord (              { Updates the current record }
  4584.       hCursor       : hDBICur;          { Cursor handle }
  4585.       pRecBuf       : Pointer;          { Modified record }
  4586.       bFreeLock     : Bool              { Free record lock }
  4587.    ): DBIResult stdcall;
  4588.  
  4589. function DbiDeleteRecord (              { Deletes the current record }
  4590.       hCursor       : hDBICur;          { Cursor handle }
  4591.       pRecBuf       : Pointer           { Copy of deleted record }
  4592.    ): DBIResult stdcall;
  4593.  
  4594. function DbiReadBlock (                 { Read a block of records }
  4595.       hCursor       : hDBICur;          { Cursor handle }
  4596. var   iRecords      : Longint;          { Number of records to read }
  4597.       pBuf          : Pointer           { Buffer }
  4598.    ): DBIResult stdcall;
  4599.  
  4600. function DbiWriteBlock (                { Write a block of records }
  4601.       hCursor       : hDBICur;          { Cursor handle }
  4602. var   iRecords      : Longint;          { Number of records to write/written }
  4603.       pBuf          : Pointer           { Buffer }
  4604.    ): DBIResult stdcall;
  4605.  
  4606. function DbiAppendRecord (              { Inserts a new record }
  4607.       hCursor       : hDBICur;          { Cursor handle }
  4608.       pRecBuff      : Pointer           { New Record (client) }
  4609.    ): DBIResult stdcall;
  4610.  
  4611. function DbiUndeleteRecord (            { Undeletes the current record }
  4612.       hCursor       : hDBICur           { Cursor handle }
  4613.    ): DBIResult stdcall;
  4614.  
  4615. function DbiGetSeqNo (                  { Get logical record number }
  4616.       hCursor       : hDBICur;          { Cursor handle }
  4617. var   iSeqNo        : Longint           { Pointer to sequence number }
  4618.    ): DBIResult stdcall;
  4619.  
  4620. function DbiSetToSeqNo (                { Position to a logical record number }
  4621.       hCursor       : hDBICur;          { Cursor handle }
  4622.       iSeqNo        : Longint           { Sequence number }
  4623.    ): DBIResult stdcall;
  4624.  
  4625. function DbiGetRecordCount (            { Get the current number of records }
  4626.       hCursor       : hDBICur;          { Cursor handle }
  4627. var   iRecCount     : Longint           { Number of records }
  4628.    ): DBIResult stdcall;
  4629.  
  4630.  
  4631. function DbiGetExactRecordCount (       { Get the exact number of records }
  4632.       hCursor       : hDBICur;          { Cursor handle }
  4633. var   iRecCount     : Longint           { Number of records }
  4634.    ): DBIResult stdcall;
  4635.  
  4636.  
  4637. function DbiSetToRecordNo (             { Position to Physical Rec# }
  4638.       hCursor       : hDBICur;          { Cursor handle }
  4639.       iRecNo        : Longint           { Physical record number }
  4640.    ): DBIResult stdcall;
  4641.  
  4642. function DbiSaveChanges (               { Flush all buffered changes }
  4643.       hCursor       : hDBICur           { Cursor handle }
  4644.    ): DBIResult stdcall;
  4645.  
  4646. function DbiForceReread (               { Force Reread of buffers from Disk }
  4647.       hCursor       : hDBICur           { Cursor }
  4648.    ): DBIResult stdcall;
  4649.  
  4650. function DbiCheckRefresh: DBIResult stdcall;    { Check refresh for session }
  4651.  
  4652. function DbiMakePermanent (             { Make temporary table permanent }
  4653.       hCursor       : hDBICur;          { Cursor handle }
  4654.       pszName       : PChar;            { Rename temporary table }
  4655.       bOverWrite    : Bool              { Overwrite existing file }
  4656.    ): DBIResult stdcall;
  4657.  
  4658. function DbiForceRecordReread (         { Force Reread of current record from Server }
  4659.       hCursor       : hDBICur;          { Cursor handle }
  4660.       pRecBuff      : Pointer           { Returned : record buffer }
  4661.    ): DBIResult stdcall;
  4662.  
  4663. {============================================================================}
  4664. {                            Field Level Access                              }
  4665. {============================================================================}
  4666.  
  4667. function DbiGetField (                  { Get Field value }
  4668.       hCursor       : hDBICur;          { Cursor }
  4669.       iField        : Word;             { Field # (1..n) }
  4670.       pRecBuff      : Pointer;          { Record buffer }
  4671.       pDest         : Pointer;          { Destination field buffer }
  4672. var   bBlank        : Bool              { Returned : is field blank }
  4673.    ): DBIResult stdcall;
  4674.  
  4675. function DbiPutField (                  { Put a value in the record buffer }
  4676.       hCursor       : hDBICur;          { Cursor }
  4677.       iField        : Word;             { Field # (1..n) }
  4678.       pRecBuff      : Pointer;          { Record buffer }
  4679.       pSrc          : Pointer           { Source field buffer }
  4680.    ): DBIResult stdcall;
  4681.  
  4682. function DbiVerifyField (               { Verifies the field value }
  4683.       hCursor       : hDBICur;          { Cursor }
  4684.       iField        : Word;             { Field # (1..n) }
  4685.       pSrc          : Pointer;          { Field Value }
  4686. var   bBlank        : Bool              { Field is Blank (Returned) }
  4687.    ): DBIResult stdcall;
  4688.  
  4689. function DbiOpenBlob (                  { Open a blob for access }
  4690.       hCursor       : hDBICur;          { Cursor handle }
  4691.       pRecBuf       : Pointer;          { Record Buffer }
  4692.       iField        : Word;             { Field number (1..n) }
  4693.       eOpenMode     : DBIOpenMode       { Open for Read or RW }
  4694.    ): DBIResult stdcall;
  4695.  
  4696. function DbiGetBlobSize (               { Gets the size of a blob }
  4697.       hCursor       : hDBICur;          { Cursor handle }
  4698.       pRecBuf       : Pointer;          { Record Buffer }
  4699.       iField        : Word;             { Field number of blob (1..n) }
  4700. var   iSize         : Longint           { Blob size in bytes }
  4701.    ): DBIResult stdcall;
  4702.  
  4703. function DbiGetBlob (                   { Read bytes from blob }
  4704.       hCursor       : hDBICur;          { Cursor handle }
  4705.       pRecBuf       : Pointer;          { Record Buffer }
  4706.       iField        : Word;             { Field number of blob (1..n) }
  4707.       iOffSet       : Longint;          { Starting position }
  4708.       iLen          : Longint;          { No of bytes to be read }
  4709.       pDest         : Pointer;          { Destination }
  4710. var   iRead         : Longint           { Actual no of bytes read }
  4711.    ): DBIResult stdcall;
  4712.  
  4713. function DbiPutBlob (                   { Write bytes to blob }
  4714.       hCursor       : hDBICur;          { Cursor handle }
  4715.       pRecBuf       : Pointer;          { Record Buffer }
  4716.       iField        : Word;             { Field number of blob (1..n) }
  4717.       iOffSet       : Longint;          { Starting position }
  4718.       iLen          : Longint;          { No of bytes to put }
  4719.       pSrc          : Pointer           { pntr to Source }
  4720.    ): DBIResult stdcall;
  4721.  
  4722. function DbiTruncateBlob (              { Reduces the blob size }
  4723.       hCursor       : hDBICur;          { Cursor handle }
  4724.       pRecBuf       : Pointer;          { Record Buffer }
  4725.       iField        : Word;             { Field number of blob (1..n) }
  4726.       iLen          : Longint           { New blob length }
  4727.    ): DBIResult stdcall;
  4728.  
  4729. function DbiFreeBlob (                  { Closes the blob }
  4730.       hCursor       : hDBICur;          { Cursor handle }
  4731.       pRecBuf       : Pointer;          { Record Buffer }
  4732.       iField        : Word              { Field number of blob (0..n) }
  4733.    ): DBIResult stdcall;
  4734.  
  4735. function DbiGetBlobHeading (            { Get Blob Heading }
  4736.       hCursor       : hDBICur;          { Cursor handle }
  4737.       iField        : Word;             { Field number of blob (1..n) }
  4738.       pRecBuf       : Pointer;          { Record buffer of owner record }
  4739.       pDest         : Pointer           { Destination buffer }
  4740.    ): DBIResult stdcall;
  4741.  
  4742. function DbiSetFieldMap (               { Set a fieldmap }
  4743.       hCur          : hDBICur;          { Cursor handle }
  4744.       iFields       : Word;             { Number of fields }
  4745.       pFldDesc      : pFLDDesc          { Array of field descriptions }
  4746.    ): DBIResult stdcall;
  4747.  
  4748.  
  4749. {=============================================================================}
  4750. {                                TRANSACTIONS                                 }
  4751. {=============================================================================}
  4752.  
  4753. function DbiBeginTran (                 { Begin a transaction }
  4754.       hDb           : hDBIDb;           { Database handle }
  4755.       eXIL          : eXILType;         { Transaction isolation level }
  4756. var   hXact         : hDBIXact          { Returned Xact handle }
  4757.    ): DBIResult stdcall;
  4758.  
  4759. function DbiEndTran (                   { End a transaction }
  4760.       hDb           : hDBIDb;           { Database handle }
  4761.       hXact         : hDBIXact;         { Xact handle }
  4762.       eEnd          : eXEnd             { Xact end type }
  4763.    ): DBIResult stdcall;
  4764.  
  4765. function DbiGetTranInfo (               { Get transaction info }
  4766.       hDb           : hDBIDb;           { Database handle }
  4767.       hXact         : hDBIXact;         { Xact handle }
  4768.       pxInfo        : pXInfo            { Xact info }
  4769.    ): DBIResult stdcall;
  4770.  
  4771. {=============================================================================}
  4772. {                                  LOCKING                                    }
  4773. {=============================================================================}
  4774.  
  4775. function DbiAcqTableLock (              { Lock a table }
  4776.       hCursor       : hDBICur;          { Cursor handle }
  4777.       eLockType     : DBILockType       { Lock type }
  4778.    ): DBIResult stdcall;
  4779.  
  4780. function DbiAcqPersistTableLock (       { Get a persistent lock }
  4781.       hDb           : hDBIDb;           { Database handle }
  4782.       pszTableName  : PChar;            { Table name }
  4783.       pszDriverType : PChar             { Driver type / NULL }
  4784.    ): DBIResult stdcall;
  4785.  
  4786. function DbiRelPersistTableLock (       { Releases a persistent lock }
  4787.       hDb           : hDBIDb;           { Database handle }
  4788.       pszTableName  : PChar;            { Table name }
  4789.       pszDriverType : PChar             { Driver type / NULL }
  4790.    ): DBIResult stdcall;
  4791.  
  4792. function DbiRelTableLock (              { Unlocks Table level locks }
  4793.       hCursor       : hDBICur;          { Cursor handle }
  4794.       bAll          : Bool;             { True for all table level locks }
  4795.       eLockType     : DBILockType       { Specific lock type }
  4796.    ): DBIResult stdcall;
  4797.  
  4798. function DbiRelRecordLock (             { Releases record level locks }
  4799.       hCursor       : hDBICur;          { Cursor handle }
  4800.       bAll          : Bool              { True for all. Default Current. }
  4801.    ): DBIResult stdcall;
  4802.  
  4803. function DbiIsRecordLocked (            { Check if current record is locked }
  4804.       hCursor       : hDBICur;          { Cursor handle }
  4805. var   bLocked       : Bool              { Rec lock status }
  4806.    ): DBIResult stdcall;
  4807.  
  4808. function DbiIsTableLocked (             { Verify if Table is locked }
  4809.       hCursor       : hDBICur;          { Cursor handle }
  4810.       epdxLock      : DBILockType;      { Lock type to verify }
  4811. var   iLocks        : Word              { Nbr of locks of the given type }
  4812.    ): DBIResult stdcall;
  4813.  
  4814. function DbiIsTableShared (             { Verify if this is a shared table }
  4815.       hCursor       : hDBICur;          { Cursor handle }
  4816. var   bShared       : Bool              { Shared status }
  4817.    ): DBIResult stdcall;
  4818.  
  4819. function DbiOpenLockList (              { Get a list of locks }
  4820.       hCursor       : hDBICur;          { Cursor handle }
  4821.       bAllUsers     : Bool;             { True, for all Users locks }
  4822.       bAllLockTypes : Bool;             { True, for all lock types }
  4823. var   hLocks        : hDBICur           { Returned cursor on Lock list }
  4824.    ): DBIResult stdcall;
  4825.  
  4826. function DbiOpenUserList (              { Get a list of users loggedin }
  4827. var   hUsers        : hDBICur           { Returned cursor on user list }
  4828.    ): DBIResult stdcall;
  4829.  
  4830. function DbiSetLockRetry (              { Set Lock wait time }
  4831.       iWait         : SmallInt          { Time in seconds }
  4832.    ): DBIResult stdcall;
  4833.  
  4834. {============================================================================}
  4835. {                              Batch Operations                              }
  4836. {============================================================================}
  4837.  
  4838.  
  4839. function DbiBatchMove (                 { Copy records to destination table }
  4840.       pSrcTblDesc   : pBATTblDesc;      { Source table identification, }
  4841.       hSrcCur       : hDBICur;          {  OR source cursor  ( one must be NULL ) }
  4842.       pDstTblDesc   : pBATTblDesc;      { Destination table identification, }
  4843.       hDstCur       : hDBICur;          {  OR destination cursor ( one must be NULL ) }
  4844.       ebatMode      : eBATMode;         { Batch mode }
  4845.       iFldCount     : Word;             { Size of field maps }
  4846.       pSrcFldMap    : PWord;            { Array of source field numbers }
  4847.       pszIndexName  : PChar;            { If update mode, used to match records }
  4848.       pszIndexTagName : PChar;          { Index tag name }
  4849.       iIndexId      : Word;             { Index  id }
  4850.       pszKeyviolName : PChar;           { Keyviol table name  (optional) }
  4851.       pszProblemsName : PChar;          { Problems table name (optional) }
  4852.       pszChangedName : PChar;           { Changed table name (optional) }
  4853.       lProbRecs     : PLongint;         { Number records written to problem table }
  4854.       lKeyvRecs     : PLongint;         { Number records written to keyv table }
  4855.       lChangedRecs  : PLongint;         { Number records written to changed table }
  4856.       bAbortOnFirstProb : Bool;         { If TRUE, abort on first problem rec }
  4857.       bAbortOnFirstKeyviol : Bool;      { If TRUE, abort on first keyviol rec }
  4858. var   lRecsToMove   : Longint;          { Number of records to read from source }
  4859.       bTransliterate : Bool             { If TRUE, transliterate character data }
  4860.    ): DBIResult stdcall;
  4861.  
  4862. function DbiCopyTable (                 { Copy one table to another }
  4863.       hDb           : hDBIDb;           { Database handle }
  4864.       bOverWrite    : Bool;             { True, to overwrite existing file }
  4865.       pszSrcTableName : PChar;          { Source table name }
  4866.       pszSrcDriverType : PChar;         { Source driver type }
  4867.       pszDestTableName : PChar          { Destination table name }
  4868.    ): DBIResult stdcall;
  4869.  
  4870. function DbiEmptyTable (                { Deletes all records }
  4871.       hDb           : hDBIDb;           { Database handle }
  4872.       hCursor       : hDBICur;          { Cursor (OR) }
  4873.       pszTableName  : PChar;            { Table name }
  4874.       pszDriverType : PChar             { Driver type /NULL }
  4875.    ): DBIResult stdcall;
  4876.  
  4877. function DbiPackTable (                 { Pack a table }
  4878.       hDb           : hDBIDb;           { Database handle }
  4879.       hCursor       : hDBICur;          { Cursor (OR) }
  4880.       pszTableName  : PChar;            { Table name }
  4881.       pszDriverType : PChar;            { Driver type /NULL }
  4882.       bRegenIdxs    : Bool              { Regenerate indexes }
  4883.    ): DBIResult stdcall;
  4884.  
  4885. function DbiRegenIndex (                { Regenerate an index }
  4886.       hDb           : hDBIDb;           { Database handle }
  4887.       hCursor       : hDBICur;          { Cursor (OR) }
  4888.       pszTableName  : PChar;            { Table name }
  4889.       pszDriverType : PChar;            { Driver type /NULL }
  4890.       pszIndexName  : PChar;            { Index name }
  4891.       pszIndexTagName : PChar;          { Index tagname (xbase MDX) }
  4892.       iIndexId      : Word              { Index number }
  4893.    ): DBIResult stdcall;
  4894.  
  4895. function DbiRegenIndexes (              { Regenerate all indexes }
  4896.       hCursor       : hDBICur           { Cursor }
  4897.    ): DBIResult stdcall;
  4898.  
  4899. function DbiSortTable (                 { Sort table }
  4900.       hDb           : hDBIDb;           { Database handle }
  4901.       pszTableName  : PChar;            { Table name of source }
  4902.       pszDriverType : PChar;            { Driver type /NULL }
  4903.       hSrcCur       : hDBICur;          { OR cursor of table to sort }
  4904.       pszSortedName : PChar;            { Destination table (NULL if sort to self) }
  4905.       phSortedCur   : phDBICur;         { If non-null, return cursor on destination }
  4906.       hDstCur       : hDBICur;          { OR cursor of destination }
  4907.       iSortFields   : Word;             { Number of sort fields }
  4908.       piFieldNum    : PWord;            { Array of field numbers }
  4909.       pbCaseInsensitive : PBool;        { Which fields should sort c-i (Opt) }
  4910.       pSortOrder    : pSORTOrder;       { Array of Sort orders (Opt) }
  4911.       ppfSortFn     : ppfSORTCompFn;    { Array of compare fn pntrs (Opt) }
  4912.       bRemoveDups   : Bool;             { TRUE : Remove duplicates }
  4913.       hDuplicatesCur : hDBICur;         { Cursor to duplicates table (Opt) }
  4914. var   lRecsSort     : Longint           { In/out param. - sort this number }
  4915.    ): DBIResult stdcall;
  4916.  
  4917.  
  4918. {============================================================================}
  4919. {                           Create & Restructure                             }
  4920. {============================================================================}
  4921.  
  4922. function DbiCreateTable (               { Create a new table }
  4923.       hDb           : hDBIDb;           { Database handle }
  4924.       bOverWrite    : Bool;             { True, to overwrite existing file. }
  4925. var   crTblDsc      : CRTblDesc         { Table description }
  4926.    ): DBIResult stdcall;
  4927.  
  4928. function DbiCreateInMemTable (          { Create a temporary table (Logical) }
  4929.       hDb           : hDBIDb;           { Database handle }
  4930.       pszName       : PChar;            { Logical Name }
  4931.       iFields       : Word;             { No of fields }
  4932.       pfldDesc      : pFLDDesc;         { Array of field descriptors }
  4933. var   hCursor       : hDBICur           { Returned cursor handle }
  4934.    ): DBIResult stdcall;
  4935.  
  4936. function DbiCreateTempTable (           { Create temporary table (Physical) }
  4937.       hDb           : hDBIDb;           { Database handle }
  4938. var   crTblDsc      : CRTblDesc;        { Table description }
  4939. var   hCursor       : hDBICur           { Returned cursor on table }
  4940.    ): DBIResult stdcall;
  4941.  
  4942. function DbiDoRestructure (             { Restructure a table }
  4943.       hDb           : hDBIDb;           { Database handle }
  4944.       iTblDescCount : Word;             { Number of table descriptors (1) }
  4945.       pTblDesc      : pCRTblDesc;       { Array of table descs }
  4946.       pszSaveAs     : PChar;            { Restructure to this table }
  4947.       pszKeyviolName : PChar;           { Keyviol table name  (optional) }
  4948.       pszProblemsName : PChar;          { Problems table name (optional) }
  4949.       bAnalyzeOnly  : Bool              { Analyze restructure }
  4950.    ): DBIResult stdcall;
  4951.  
  4952. function DbiRenameTable (               { Rename table & family }
  4953.       hDb           : hDBIDb;           { Database handle }
  4954.       pszOldName    : PChar;            { Old name }
  4955.       pszDriverType : PChar;            { Driver type /NULL }
  4956.       pszNewName    : PChar             { New name }
  4957.    ): DBIResult stdcall;
  4958.  
  4959. function DbiDeleteTable (               { Delete a table }
  4960.       hDb           : hDBIDb;           { Database handle }
  4961.       pszTableName  : PChar;            { Name including any path }
  4962.       pszDriverType : PChar             { Driver type /NULL }
  4963.    ): DBIResult stdcall;
  4964.  
  4965. function DbiAddIndex (                  { Add a new index }
  4966.       hDb           : hDBIDb;           { Database handle }
  4967.       hCursor       : hDBICur;          { Cursor (OR) }
  4968.       pszTableName  : PChar;            { Table name including any path }
  4969.       pszDriverType : PChar;            { Driver type /NULL }
  4970. var   IdxDesc       : IDXDesc;          { Description of the index }
  4971.       pszKeyviolName : PChar            { Keyviol table name (optional) }
  4972.    ): DBIResult stdcall;
  4973.  
  4974. function DbiDeleteIndex (               { Delete index }
  4975.       hDb           : hDBIDb;           { Database handle }
  4976.       hCursor       : hDBICur;          { Cursor (OR) }
  4977.       pszTableName  : PChar;            { Table name }
  4978.       pszDriverType : PChar;            { Driver type /NULL }
  4979.       pszIndexName  : PChar;            { Index name }
  4980.       pszIndexTagName : PChar;          { Index tagname (xbase MDX) }
  4981.       iIndexId      : Word              { Index number }
  4982.    ): DBIResult stdcall;
  4983.  
  4984. {===========================================================================}
  4985. {                            Error Info                                     }
  4986. {===========================================================================}
  4987.  
  4988. function DbiGetErrorEntry (             { Get error entry }
  4989.       uEntry        : Word;             { Error stack entry }
  4990. var   ulNativeError : Longint;          { Returned. Native error code, if any }
  4991.       pszError      : PChar             { Returned. Error string, if any }
  4992.    ): DBIResult stdcall;
  4993.  
  4994. function DbiGetErrorInfo (              { Return info on last error }
  4995.       bFull         : Bool;             { If Full details }
  4996. var   ErrInfo       : DBIErrInfo        { Error Info }
  4997.    ): DBIResult stdcall;
  4998.  
  4999. function DbiGetErrorString (            { Get message for error code }
  5000.       rslt          : DBIResult;        { Engine error code }
  5001.       pszError      : PChar             { Error string for the error }
  5002.    ): DBIResult stdcall;
  5003.  
  5004. function DbiGetErrorContext (           { Get specific Context if available }
  5005.       eContext      : SmallInt;         { Context type }
  5006.       pszContext    : PChar             { Context string (MAXMSGLEN +1) }
  5007.    ): DBIResult stdcall;
  5008.  
  5009. {============================================================================}
  5010. {                              Dbi Services                                  }
  5011. {============================================================================}
  5012.  
  5013. function DbiDateEncode (                { Encode Date components into Date }
  5014.       iMon          : Word;             { Month    (1..12) }
  5015.       iDay          : Word;             { Day      (1..31) }
  5016.       iYear         : SmallInt;         { Year     (0..2**16-1) }
  5017. var   dateD         : DBIDATE           { Encoded date }
  5018.    ): DBIResult stdcall;
  5019.  
  5020. function DbiDateDecode (                { Decode Date into components }
  5021.       dateD         : DBIDATE;          { Encoded Date }
  5022. var   iMon          : Word;             { Month }
  5023. var   iDay          : Word;             { Day }
  5024. var   iYear         : SmallInt          { Year }
  5025.    ): DBIResult stdcall;
  5026.  
  5027. function DbiTimeEncode (                { Encode Time components into TIME }
  5028.       iHour         : Word;             { Hours (0..23) }
  5029.       iMin          : Word;             { Minutes (0..59) }
  5030.       iMilSec       : Word;             { Milli Seconds (0..59999) }
  5031. var   timeT         : Time              { Encoded Time }
  5032.    ): DBIResult stdcall;
  5033.  
  5034. function DbiTimeDecode (                { Decode TIME into components }
  5035.       timeT         : Time;             { Encoded Time }
  5036. var   iHour         : Word;             { Hours (0..23) }
  5037. var   iMin          : Word;             { Minutes (0..59) }
  5038. var   iMilSec       : Word              { Milli Seconds (0..59999) }
  5039.    ): DBIResult stdcall;
  5040.  
  5041. function DbiTimeStampEncode (           { Encode Date & TIme into Date+Time }
  5042.       dateD         : DBIDATE;          { Encoded Date }
  5043.       timeT         : Time;             { Encoded Time }
  5044. var   tsTS          : TimeStamp         { Encoded Date+Time }
  5045.    ): DBIResult stdcall;
  5046.  
  5047. function DbiTimeStampDecode (           { Decode Date & Time from Date+Time }
  5048.       tsTS          : TIMESTAMP;        { Encoded Date+Time }
  5049. var   dateD         : DBIDATE;          { Encoded Date }
  5050. var   timeT         : Time              { Encoded Time }
  5051.    ): DBIResult stdcall;
  5052.  
  5053.  
  5054. function DbiBcdFromFloat (              { Converts FLOAT number into FMTBcd format }
  5055. var   iVal          : Double;           { Float to convert }
  5056.       iPrecision    : Word;             { Precision of BCD }
  5057.       iPlaces       : Word;             { Number of decimals }
  5058. var   Bcd           : FMTBcd            { returns Bcd number (length = iPrecision +2) }
  5059.    ): DBIResult stdcall;
  5060.  
  5061. function DbiBcdToFloat (                { Converts FMTBcd number to FLOAT }
  5062. var   Bcd           : FMTBcd;           { Bcd number to convert }
  5063. var   iVal          : Double            { Returns converted float }
  5064.    ): DBIResult stdcall;
  5065.  
  5066. {===========================================================================}
  5067. {                           CallBacks                                       }
  5068. {===========================================================================}
  5069.  
  5070. function DbiRegisterCallBack (          { Register a call back fn }
  5071.       hCursor       : hDBICur;          { Cursor (Optional) }
  5072.       ecbType       : CBType;           { Type of call back }
  5073.       iClientData   : Longint;          { Pass-thru client data }
  5074.       iCbBufLen     : Word;             { Callback buffer len }
  5075.       CbBuf         : Pointer;          { Pointer to callback buffer }
  5076.       pfCb          : pfDBICallBack     { Call back fn being registered }
  5077.    ): DBIResult stdcall;
  5078.  
  5079. function DbiGetCallBack (               { Register a call back fn }
  5080.       hCursor       : hDBICur;          { Cursor (Optional) }
  5081.       ecbType       : CBType;           { Type of call back }
  5082.       piClientData  : PLongint;         { Pass-thru client data }
  5083.       piCbBufLen    : PWord;            { Callback buffer len }
  5084.       ppCbBuf       : Pointer;          { Pointer to callback buffer }
  5085. var   pfCb          : pfDBICallBack     { Call back fn being registered }
  5086.    ): DBIResult stdcall;
  5087.  
  5088. {============================================================================}
  5089. {                          Date, time formats                                }
  5090. {============================================================================}
  5091.  
  5092.  
  5093. function DbiGetDateFormat (             { Get current date format }
  5094. var   fmtDate       : FMTDate
  5095.    ): DBIResult stdcall;
  5096.  
  5097. function DbiSetDateFormat (             { Set current date format }
  5098. var   fmtDate       : FMTDate
  5099.    ): DBIResult stdcall;
  5100.  
  5101. function DbiGetTimeFormat (             { Get current time format }
  5102. var   fmtTime       : FMTTime
  5103.    ): DBIResult stdcall;
  5104.  
  5105. function DbiSetTimeFormat (             { Set current time format }
  5106. var   fmtTime       : FMTTime
  5107.    ): DBIResult stdcall;
  5108.  
  5109. function DbiGetNumberFormat (           { Get current number format }
  5110. var   fmtNumber     : FMTNumber
  5111.    ): DBIResult stdcall;
  5112.  
  5113. function DbiSetNumberFormat (           { Set current number format }
  5114. var   fmtNumber     : FMTNumber
  5115.    ): DBIResult stdcall;
  5116.  
  5117. {============================================================================}
  5118. {                      Conversions                                           }
  5119. {============================================================================}
  5120.  
  5121. function DbiNativeToAnsi (              { Convert from native to Ansi }
  5122.       LdObj         : Pointer;          { Language driver }
  5123.       pAnsiStr      : PChar;            { Destination buffer (opt) }
  5124.       pNativeStr    : PChar;            { Source buffer }
  5125.       iLen          : Longint;          { Length of buffer (opt) }
  5126. var   bDataLoss     : Bool              { Returns TRUE if conversion will loose data (opt) }
  5127.    ): DBIResult stdcall;
  5128.  
  5129. function DbiAnsiToNative (              { Convert from Ansi to native }
  5130.       LdObj         : Pointer;          { Language driver }
  5131.       pNativeStr    : PChar;            { Destination buffer (opt) }
  5132.       pAnsiStr      : PChar;            { Source buffer }
  5133.       iLen          : Longint;          { Length of buffer (opt) }
  5134. var   bDataLoss     : Bool              { Returns TRUE if conversion will loose data (opt) }
  5135.    ): DBIResult stdcall;
  5136.  
  5137. {============================================================================}
  5138. {                            Filters                                         }
  5139. {============================================================================}
  5140.  
  5141. function DbiAddFilter (                 { Add a filter to the cursor }
  5142.       hCursor       : hDBICur;          { Cursor handle }
  5143.       iClientData   : Longint;          { Client supplied data      (opt) }
  5144.       iPriority     : Word;             { 1..N with 1 being highest (opt) }
  5145.       bCanAbort     : Bool;             { TRUE if pfFiltercan return ABORT (opt) }
  5146.       pcanExpr      : pCANExpr;         { Expression tree        (opt) }
  5147.       pfFilter      : pfGENFilter;      { ptr to filter function (opt) }
  5148. var   hFilter       : hDBIFilter        { Returns filter handle }
  5149.    ): DBIResult stdcall;
  5150.  
  5151. function DbiDropFilter (                { Drop a filter }
  5152.       hCursor       : hDBICur;          { Cursor handle }
  5153.       hFilter       : hDBIFilter        { Filter handle }
  5154.    ): DBIResult stdcall;
  5155.  
  5156. function DbiActivateFilter (            { Activate a Filter }
  5157.       hCursor       : hDBICur;          { Cursor handle }
  5158.       hFilter       : hDBIFilter        { Filter handle }
  5159.    ): DBIResult stdcall;
  5160.  
  5161. function DbiDeactivateFilter (          { Deactivate Filter }
  5162.       hCursor       : hDBICur;          { Cursor handle }
  5163.       hFilter       : hDBIFilter        { Filter handle }
  5164.    ): DBIResult stdcall;
  5165.  
  5166. function DbiGetFilterInfo (             { Get filter information }
  5167.       hCur          : hDBICur;          { Cursor handle }
  5168.       hFilter       : hDBIFilter;       { Filter handle          /NULL }
  5169.       iFilterId     : Word;             { Filter id              /0 }
  5170.       iFilterSeqNo  : Word;             { Filter sequence number /0 }
  5171. var   Filterinfo    : FilterInfo        { Returns filter info }
  5172.    ): DBIResult stdcall;
  5173.  
  5174. {============================================================================}
  5175. {                            Linked Cursors                                  }
  5176. {============================================================================}
  5177.  
  5178. function DbiBeginLinkMode (             { Convert cursor to a link cursor }
  5179. var   hCursor       : hDBICur           { In/Out : returns new cursor }
  5180.    ): DBIResult stdcall;
  5181.  
  5182. function DbiEndLinkMode (               { Convert cursor back to normal cursor }
  5183. var   hCursor       : hDBICur           { In/Out : returns original cursor }
  5184.    ): DBIResult stdcall;
  5185.  
  5186. function DbiLinkDetail (                { Link detail to master }
  5187.       hMstrCursor   : hDBICur;          { Master cursor }
  5188.       hDetlCursor   : hDBICur;          { Detail cursor }
  5189.       iLnkFields    : Word;             { Number of link fields }
  5190.       piMstrFields  : PWord;            { Array of fields in master }
  5191.       piDetlFields  : PWord             { Array of fields in detail }
  5192.    ): DBIResult stdcall;
  5193.  
  5194. function DbiLinkDetailToExp (           { Link detail to a master using exp }
  5195.       hCursorMstr   : hDBICur;          { Master cursor }
  5196.       hCursorDetl   : hDBICur;          { Detail cursor }
  5197.       iKeyLen       : Word;             { Key length to match }
  5198.       pszMstrExp    : PChar             { Expression string }
  5199.    ): DBIResult stdcall;
  5200.  
  5201. function DbiUnlinkDetail (              { Unlink detail from master }
  5202.       hDetlCursor   : hDBICur           { Detail cursor to unlink }
  5203.    ): DBIResult stdcall;
  5204.  
  5205. function DbiGetLinkStatus (             { Query linkage info for table }
  5206.       hCursor       : hDBICur;          { Cursor handle }
  5207. var   hCursorMstr   : hDBICur;          { Returns master cursor, if any   (opt) }
  5208. var   hCursorDet    : hDBICur;          { Returns first detail cursor, if any (opt) }
  5209. var   hCursorSib    : hDBICur           { Returns next sibling detail cursor, if any (opt) }
  5210.    ): DBIResult stdcall;
  5211.  
  5212.  
  5213. {===========================================================================}
  5214. {                            Translation                                    }
  5215. {===========================================================================}
  5216.  
  5217.  
  5218. function DbiTranslateRecordStructure (  { Translate a record }
  5219.       pszSrcDriverType : PChar;         { Source driver type }
  5220.       iFlds         : Word;             { Number of fields }
  5221.       pfldsSrc      : pFLDDesc;         { Array of source fields: logical or physical types }
  5222.       pszDstDriverType : PChar;         { Destination driver type }
  5223.       pszLangDriver : PChar;            { Language driver for destination }
  5224.       pfldsDst      : pFLDDesc;         { Array of dest. fields returned }
  5225.       bCreatable    : Bool              { TRUE -> map to creatable fields only. }
  5226.    ): DBIResult stdcall;
  5227.  
  5228. function DbiOpenFieldXlt (              { Open translation object }
  5229.       pszSrcTblType : PChar;            { NULL for Logical }
  5230.       pszSrcLangDrv : PChar;            { NULL if no tranliteration }
  5231.       pfldSrc       : pFLDDesc;         { source field descriptor }
  5232.       pszDestTblType : PChar;           { NULL for Logical }
  5233.       pszDstLangDrv : PChar;            { NULL if no tranliteration }
  5234.       pfldDest      : pFLDDesc;         { Source field descriptor }
  5235. var   bDataLoss     : Bool;             { Set to TRUE, for data loss }
  5236. var   hXlt          : hDBIXlt           { Returned translate handle }
  5237.    ): DBIResult stdcall;
  5238.  
  5239. function DbiTranslateField (            { Translate a field }
  5240.       hXlt          : hDBIXlt;          { Translation handle }
  5241.       pSrc          : Pointer;          { Source field }
  5242.       pDest         : Pointer           { Destination field }
  5243.    ): DBIResult stdcall;
  5244.  
  5245. function DbiCloseFieldXlt (             { Close translation object }
  5246.       hXlt          : hDBIXlt           { Translation handle }
  5247.    ): DBIResult stdcall;
  5248.  
  5249. {=========================================================================}
  5250. {    Delayed Updates                                                      }
  5251. {=========================================================================}
  5252.  
  5253. function DbiBeginDelayedUpdates (       { put cursor in delayed update mode }
  5254. var   hCursor       : hDBICur           { In/Out : returns new Cursor }
  5255.    ): DBIResult stdcall;
  5256.  
  5257. function DbiEndDelayedUpdates (         { Convert cursor back to normal cursor }
  5258. var   hCursor       : hDBICur           { In/Out : returns original Cursor }
  5259.    ): DBIResult stdcall;
  5260.  
  5261. function DbiApplyDelayedUpdates (       { Perform the specified operation. }
  5262.       hCursor       : hDBICur;          { Delayed update cursor handle }
  5263.       eUpdCmd       : DBIDelayedUpdCmd  { Op Type: Commit or Rollback. }
  5264.    ): DBIResult stdcall;
  5265.  
  5266. {===========================================================================}
  5267. {                                 MISC.                                     }
  5268. {===========================================================================}
  5269.  
  5270.  
  5271. function DbiGetTableOpenCount (         {  Get local cursor count }
  5272.       hDb           : hDBIDb;           { Database }
  5273.       pszTableName  : PChar;            { Table name }
  5274.       pszDriverType : PChar;            { Driver type /NULL }
  5275. var   iOpenCount    : Word              { returned number of cursors }
  5276.    ): DBIResult stdcall;
  5277.  
  5278. function DbiUseIdleTime: DBIResult stdcall;     { Use Idle time }
  5279.  
  5280. function DbiGetLdObj (                  { Get language driver }
  5281.       hCursor       : hDBICur;          { Cursor handle }
  5282. var   pLdObj        : Pointer           { Returned language driver object }
  5283.    ): DBIResult stdcall;
  5284.  
  5285. function DbiGetLdName (                 { Get language driver name from table }
  5286.       pszDriver     : PChar;            { Driver name }
  5287.       pObjName      : PChar;            { Name of object, i.e. table name }
  5288.       pLdName       : PChar             { Returned language driver name }
  5289.    ): DBIResult stdcall;
  5290.  
  5291. function DbiFormFullName (              { Form Full Name }
  5292.       hDb           : hDBIDb;           { Database handle }
  5293.       pszTableName  : PChar;            { Table name }
  5294.       pszDriverType : PChar;            { Driver type /NULL }
  5295.       pszFullName   : PChar             { Returns full name }
  5296.    ): DBIResult stdcall;
  5297.  
  5298. function DbiAddPassword (               { Add a password to current session }
  5299.       pszPassword   : PChar             { Password }
  5300.    ): DBIResult stdcall;
  5301.  
  5302. function DbiDropPassword (              { Drop a password from current session }
  5303.       pszPassword   : PChar             { password/NULL }
  5304.    ): DBIResult stdcall;
  5305.  
  5306. function DbiGetNetUserName (            { Get network username }
  5307.       pszNetUserName : PChar            { Returns username }
  5308.    ): DBIResult stdcall;
  5309.  
  5310.  
  5311. function DbiDebugLayerOptions (         { Get SDK debug layer options }
  5312.       iOption       : Word;             { Option }
  5313.       pDebugFile    : PChar
  5314.    ): DBIResult stdcall;
  5315.  
  5316. function DbiOpenCfgInfoList (           { Open a cursor on "Config" }
  5317.       hCfg          : hDBICfg;          { NULL }
  5318.       eOpenMode     : DBIOpenMode;      { ReadWrite or readonly }
  5319.       eConfigMode   : CFGMode;          { Config mode }
  5320.       pszCfgPath    : PChar;            { Path }
  5321. var   hCur          : hDBICur           { Returned cursor }
  5322.    ): DBIResult stdcall;
  5323.  
  5324. function DbiImportODBC(                 { Import current ODBC drivers and data sources }
  5325.       hCfg          : hDBICfg;          { NULL }
  5326.       bPersist      : Bool              { Persistent or session relative }
  5327.    ): DBIResult stdcall;
  5328.  
  5329. function DbiAddAlias (                  { Add a new alias }
  5330.       hCfg          : hDBICfg;          { NULL }
  5331.       pszAliasName  : PChar;            { Alias name }
  5332.       pszDriverType : PChar;            { Driver type for alias }
  5333.       pszParams     : PChar;            { Optional parameters }
  5334.       bPersist      : Bool              { Persistent or session relative }
  5335.    ): DBIResult stdcall;
  5336.  
  5337. function DbiDeleteAlias (               { Delete an alias }
  5338.       hCfg          : hDBICfg;          { NULL }
  5339.       pszAliasName  : PChar             { Alias name }
  5340.    ): DBIResult stdcall;
  5341.  
  5342. function DbiAddDriver(                  { Add a new driver }
  5343.       hCfg          : hDBICfg;          { NULL }
  5344.       pszDriverName : PChar;            { Driver name }
  5345.       pszParams     : PChar;            { Optional parameters }
  5346.       bPersist      : Bool              { Persistent or session relative }
  5347.    ): DBIResult stdcall;
  5348.  
  5349. function DbiDeleteDriver(               { Delete a driver }
  5350.       hCfg          : hDBICfg;          { NULL }
  5351.       pszDriverName : PChar;            { Driver name }
  5352.       bSave         : Bool              { Save config file }
  5353.    ): DBIResult stdcall;
  5354.  
  5355.  
  5356. {===========================================================================}
  5357. {                      Query Management                                     }
  5358. {===========================================================================}
  5359.  
  5360. function DbiQExecDirect (               { Execute query }
  5361.       hDb           : hDBIDb;           { Database handle }
  5362.       eQryLang      : DBIQryLang;       { Query language }
  5363.       pszQuery      : PChar;            { Query }
  5364.       phCur         : phDBICur          { Returned cursor on result set }
  5365.    ): DBIResult stdcall;
  5366.  
  5367. function DbiQAlloc (                    { Allocates a statement handle }
  5368.       hDb           : hDBIDb;           { Database handle }
  5369.       eQryLang      : DBIQryLang;       { Query language }
  5370. var   hStmt         : hDBIStmt          { Returned statment handle }
  5371.    ): DBIResult stdcall;
  5372.  
  5373. function DbiQPrepare (                  { Prepare a query }
  5374.       hStmt         : hDBIStmt;         { Returned statment handle }
  5375.       pszQuery      : PChar             { Query }
  5376.    ): DBIResult stdcall;
  5377.  
  5378. function DbiQPrepareExt (               { Prepare a query }
  5379.       hDb           : hDBIDb;           { Database handle }
  5380.       eQryLang      : DBIQryLang;       { Query language }
  5381.       pszQuery      : PChar;            { Query }
  5382.       propBits      : Word;             { properties for Prepare, e.g. qprepFORUPDATE }
  5383. var   hStmt         : hDBIStmt          { Returned statment handle }
  5384.    ): DBIResult stdcall;
  5385.  
  5386. function DbiQExec (                     { Execute prepared query }
  5387.       hStmt         : hDBIStmt;         { Statement handle }
  5388.       phCur         : phDBICur          { Returned handle on result set }
  5389.    ): DBIResult stdcall;
  5390.  
  5391. function DbiQFree (                     { Free statement handle }
  5392. var   hStmt         : hDBIStmt          { Statement handle }
  5393.    ): DBIResult stdcall;
  5394.  
  5395. function DbiQSetParams (                { Set query options }
  5396.       hStmt         : hDBIStmt;         { Statement handle }
  5397.       uFldDescs     : Word;             { Number of parameter field descriptors }
  5398.       paFldDescs    : pFLDDesc;         { Array of parameter field descriptors }
  5399.       pRecBuff      : Pointer           { Record buffer }
  5400.    ): DBIResult stdcall;
  5401.  
  5402. function DbiQInstantiateAnswer (        { Create answer table }
  5403.       hStmt         : hDBIStmt;         { Statement Handle }
  5404.       hCur          : hDBICur;          { Cursor Handle }
  5405.       pszAnswerName : PChar;            { Answer Table Name/NULL }
  5406.       pszAnswerType : PChar;            { Answer Table Type/NULL }
  5407.       bOverWrite    : Bool;             { Overwrite Flag }
  5408.       phCur         : phDBICur          { cursor to instantiated table (output)(optional) }
  5409.    ): DBIResult stdcall;
  5410.  
  5411. function DbiQExecProcDirect (           { Direct execution of stored procedure }
  5412.       hDb           : hDBIDb;           { Database handle }
  5413.       pszProc       : PChar;            { Stored procedure name }
  5414.       uParamDescs   : Word;             { Number of parameter descriptors }
  5415.       paParamDescs  : pSPParamDesc;     { Array of parameter descriptors }
  5416.       pRecBuff      : Pointer;          { Record buffer }
  5417. var   hCur          : hDBICur           { Returned handle on result set }
  5418.    ): DBIResult stdcall;
  5419.  
  5420. function DbiQPrepareProc (              { Prepare a stored procedure }
  5421.       hDb           : hDBIDb;           { Database handle }
  5422.       pszProc       : PChar;            { Stored procedure name }
  5423.       uParamDescs   : Word;             { Number of parameter descriptors }
  5424.       paParamDescs  : pSPParamDesc;     { Array of parameter descriptors }
  5425.       pRecBuff      : Pointer;          { Record buffer }
  5426. var   hStmt         : hDBIStmt          { Returned statment handle }
  5427.    ): DBIResult stdcall;
  5428.  
  5429. function DbiQSetProcParams (            { Set procedure params }
  5430.       hStmt         : hDBIStmt;         { Statement handle }
  5431.       uParamDescs   : Word;             { Number of parameter descriptors }
  5432.       paParamDescs  : pSPParamDesc;     { Array of parameter descriptors }
  5433.       pRecBuff      : Pointer           { Record buffer }
  5434.    ): DBIResult stdcall;
  5435.  
  5436. type
  5437.   PSTMTBaseDesc = ^STMTBaseDesc;
  5438.   STMTBaseDesc = packed record 
  5439.     szDatabase   : DBINAME; 
  5440.     szTableName  : DBITBLNAME; 
  5441.     szFieldName  : DBINAME; 
  5442.     bExpression  : Bool; 
  5443.     bAggregate   : Bool; 
  5444.     bConstant    : Bool;
  5445.   end;
  5446.  
  5447. function DbiQGetBaseDescs( 
  5448.       hStmt         : hDBIStmt;         { Statement Handle }
  5449. var   hCur          : hDBICur           { Cursor of type StatementBaseDesc }
  5450.    ): DBIResult stdcall;
  5451.  
  5452.  
  5453. implementation
  5454.